joomla2.5

Joomla: Call helper function from within a model?

依然范特西╮ 提交于 2019-12-04 09:19:50
I'm starting off with both php and Joomla development, and finding it difficult working within Joomla to do some fairly simple stuff. Went through the Joomla MVC example and Lynda (and have built a few simple views so far). I have a helper file/class/function that outputs all the userids that exist in the "completed" table so I can display a link for either a new record based on that user or edit an existing user's record. I've already used a different function in this helper file successfully in a different part of the component ( Joomla: Write and call a helper function in a component ).

joomla module development with form - how to process

好久不见. 提交于 2019-12-04 07:22:12
I'm creating a simple Joomla 2.5 module that will have an html form. mod_mymodule/tmpl/default.php : <form method="post" id="myemailform" action=""> <label for="ReferralName">Enter Name:</label><input type="text" name="name" value="<?php echo modCamcloudReferralHelper::getReferralName(); ?>"> <label for="ReferralEmail">Enter Email Address:</label><input type="text" name="email"> <label for="ReferralMessage">Enter Message (optional):</label><textarea class="message"></textarea> <span class="countdown"></span> <button type="submit" value="Send Email">Send Email</button> <?php echo JHtml::_('form

JFactory failing to import

末鹿安然 提交于 2019-12-04 06:43:47
问题 I am trying to make a login system for an android application that works in with my 2.5 Joomla website. I am trying to do this by making a Joomla plugin which the android application sends post data to a php file which that then authenticates the user to see if the credentials are correct or not for the login. I have been trying to get this working all afternoon but it seems all my attempts of importing JFactory are failing. I have the below code which bugs out at the first mention of

How to Get User Group Names in Joomla 2.5

淺唱寂寞╮ 提交于 2019-12-04 03:58:36
I'm writing a Joomla 2.5 component that I had been developing in Joomla 1.7. I have been using code like this: $user = JFactory::getUser(); $groups = $user->get('groups'); The $groups array would contain a list of ids with the group name as the index. Joomla 2.5 seems to have scrapped this functionality. I have been unable to find out how to get the group names without directly querying the database. Is there any method for getting a list of the groups a user is a member of without having to resort to querying the database? The code I generated below gets the names of all the groups the user

Joomla setRedirect doesn't work

こ雲淡風輕ζ 提交于 2019-12-03 22:13:59
I have a simple Joomla controller, but I can't redirect anything. According to the documentation: class MyController extends MyBaseController { function import() { $link = JRoute::_('index.php?option=com_foo&ctrl=bar'); $this->setRedirect($link); } } //The url contains & html escaped character instead of "&" This should work, but I get a malformed URL. Is there something I'm missing here? Why is Joomla converting all the "&" characters into & 's? How am I suppose to use setRedirect? Thank you Alright, I fixed it. So if anyone needs it: instead of $link = JRoute::_('index.php?option=com_foo

Joomla 2.5 calendar field type in custom form date and time selection

别说谁变了你拦得住时间么 提交于 2019-12-03 22:11:53
I have two fields in my admin/componsents/com_xxxxx/models/forms/xxxxx.xml file. these feed into an input form for administrators on the back end of Joomla 2.5 <field name="f_start" type="calendar" class="inputbox" required="true" format="%Y-%m-%d %H:%M:%S" default="0000-00-00 09:30:00" label="COM_xxxxx_F_START" description="COM_xxxxx_F_START_DESC" filter="safehtml" /> <field name="f_end" type="calendar" class="inputbox" required="true" format="%Y-%m-%d %H:%M:%S" default="0000-00-00 19:30:30" label="COM_xxxxx_F_END" description="COM_xxxxx_F_END_DESC" filter="safehtml" /> These are essentially

How to get component parameters?

Deadly 提交于 2019-12-03 18:38:48
问题 I have a problem here and just cant solve it :-/ I am developing an Joomla component with backend. In the backend I set a parameter, the dashboardId , but I can't access them in the view. I always get data:protected (when I dump params ). It seems like I'm not allowed to access the object. Here is the default.xml : <?xml version="1.0" encoding="utf-8"?> <metadata> <layout title="Dashboard"> <message> <![CDATA[dashboard LAYOUT DESCRIPTION]]> </message> </layout> <fields name="params">

Add Custom Button to Joomla's Article Editor (TinyMCE)

天涯浪子 提交于 2019-12-03 16:58:23
问题 I'm trying to insert an additional button in Joomla's article editor. It's using the default TinyMCE plug in Extended mode. As you'll already know there are 4 buttons underneath the editor (Article, Image, Page Break and Read More). What I'd like to do is insert a 5th button. (I did attach a image button SO said I can't post as need a minimum of 10 rep points.) I have tried copying the Page Break Button plugin and renaming it etc, then re-installing it as a new plugin, but all that does it

Joomla getUser() does not show the updated user data

ぐ巨炮叔叔 提交于 2019-12-03 16:24:59
Below code allows me to show the user's name in the profile page of the Joomla profile of a user. Given that I have overridden the template to get the look and feel I want. $user =& JFactory::getUser(); if (!$user->guest) { echo 'You are logged in as:<br />'; echo 'Real name: ' . $user->name . ''; } My problem is I allow user to update his or her profile. After he updates the his name, database is updated correctly but it does not show the updated name in the profile page. When I go through Joomla docs I found out that user data is stored in the session(JFactory::getUser()). If I print_r($

Joomla Database - How to use LIMIT in getQuery?

Deadly 提交于 2019-12-03 08:35:37
问题 I want to build the below query using joomla inbuilt database class. SELECT * FROM table_name ORDER BY id DESC LIMIT 1 This is the query I have built up to now. $db =& JFactory::getDBO(); $query = $db->getQuery(true); $query->select($db->nameQuote('*')); $query->from($db->nameQuote(TABLE_PREFIX.'table_name')); $db->setQuery($query); $rows = $db->loadObjectList(); I don't know how to add the limit(LIMIT 1) to the query. Can someone please tell me how to do it? Thanks 回答1: Older than Joomla 3.0