/contentmanager/code/trunk/administrator/components/com_contentmanager/controllers/rule.php
PHP | 71 lines | 40 code | 8 blank | 23 comment | 1 complexity | 7049d2715d7bd78e4e84599aa9001d81 MD5 | raw file
- <?php
- /**
- * @version $Id: rule.php 160 2009-07-09 00:06:09Z eddieajau $
- * @copyright Copyright (C) 2009 New Life in IT Pty Ltd. All rights reserved.
- * @license GNU General Public License <http://www.gnu.org/copyleft/gpl.html>
- * @link http://www.theartofjoomla.com
- */
- // no direct access
- defined('_JEXEC') or die;
- jimport('joomla.application.component.controller');
- require_once(JPATH_ADMINISTRATOR.DS.'components'.DS.'com_control'.DS.'controllers'.DS.'rule.php');
- /**
- * @package TAOJ.ContentManager
- * @subpackage com_contentmanager
- */
- class ContentManagerControllerRule extends ControlControllerRule
- {
- var $_section = array('com_contentmanager', 'com_contentmanager-emails');
- /**
- * Sets the sub-menu
- *
- * @param string The name of the active view
- */
- function setSubmenu($viewName)
- {
- JSubMenuHelper::addEntry(JText::_('CONTMAN_LINK_SPLASH_PAGES'), 'index.php?option=com_contentmanager&view=splashes');
- JSubMenuHelper::addEntry(JText::_('CONTMAN_LINK_ACCESS_CONTROL'), 'index.php?option=com_contentmanager&task=rule.display', true);
- // Check for the JXtended WYSIWYG Editor plugin
- $db = &JFactory::getDbo();
- $db->setQuery(
- 'SELECT COUNT(id)' .
- ' FROM #__plugins' .
- ' WHERE element = '.$db->quote('wysiwyg').
- ' AND folder = '.$db->quote('editors').
- ' AND published = 1'
- );
- if ($db->loadResult()) {
- JSubMenuHelper::addEntry(JText::_('CONTMAN_LINK_EDITOR_TEMPLATES'), 'index.php?option=com_contentmanager&view=templates');
- }
- }
- /**
- * Ensures the category AXO's are sync'd
- *
- * @param object An ACL model
- */
- function synchronize(&$model)
- {
- $db = &JFactory::getDBO();
- $query = new JXQuery;
- // Categories
- $query->select('c.id');
- $query->select('CONCAT_WS('.$db->Quote(' / ').',s.title,c.title) AS title');
- $query->select('(s.ordering*1000+c.ordering) AS ordering');
- $query->select('c.access');
- $query->from('#__categories AS c');
- $query->join('INNER', '#__sections AS s ON s.id = c.section');
- $query->order('s.ordering, s.title, c.ordering, c.title');
- $db->setQuery($query->toString());
- $items = $db->loadObjectList('id');
- jximport2('jxtended.acl.acladmin');
- JxAclAdmin::synchronizeAssets($items, 'com_contentmanager');
- }
- }