This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected function logData($data, $type="ERROR") | |
{ | |
jimport('joomla.log.log'); | |
$types = array( | |
'EMERGENCY', | |
'ALERT', | |
'CRITICAL', | |
'ERROR', | |
'WARNING', | |
'NOTICE', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* frontpage check | |
*/ | |
$menu = JFactory::getApplication()->getMenu(); | |
$defaultmenuitems = array($menu->getDefault()->id, $menu->getDefault(JFactory::getLanguage()->getTag())->id); | |
$isFrontpage = in_array($menu->getActive()->id, $defaultmenuitems); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Manipulation a JForm is easy the best place to add fields is to use the preprocessForm function | |
protected function preprocessForm(JForm $form, $data, $group = 'content') | |
{ | |
// Add some needed hidden fields | |
$fields = array('id','cid'); | |
foreach ($fields AS $field) | |
{ | |
$element = new SimpleXMLElement('<field></field>'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Echo a query | |
echo nl2br(str_replace('#__','jos_',$query)); | |
NewerOlder