/contentmanager/code/trunk/administrator/components/com_contentmanager/controller.php
PHP | 80 lines | 43 code | 10 blank | 27 comment | 5 complexity | 06ab53fb4b69423fb1f4567101e00fb5 MD5 | raw file
- <?php
- /**
- * @version $Id: controller.php 79 2009-05-31 08:20:59Z 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');
- /**
- * Component Controller
- *
- * @package TAOJ.ContentManager
- * @subpackage com_contentmanager
- */
- class ContentManagerController extends JController
- {
- /**
- * Display the view
- */
- function display()
- {
- // Get the document object.
- $document = &JFactory::getDocument();
- // Set the default view name and format from the Request.
- $vName = JRequest::getWord('view', 'splashes');
- $vFormat = $document->getType();
- $lName = JRequest::getWord('layout', 'default');
- // Get and render the view.
- if ($view = &$this->getView($vName, $vFormat))
- {
- switch ($vName)
- {
- default:
- $model = &$this->getModel($vName);
- break;
- }
- // Push the model into the view (as default).
- $view->setModel($model, true);
- $view->setLayout($lName);
- // Push document object into the view.
- $view->assignRef('document', $document);
- $this->_setupLinkbar($vName);
- $view->display();
- }
- }
- /**
- * Configure the Linkbar
- *
- * @param string The name of the active view
- */
- protected function _setupLinkbar($vName)
- {
- JSubMenuHelper::addEntry(JText::_('ContMan_Link_Splash_Pages'), 'index.php?option=com_contentmanager&view=splashes', $vName == 'splashes');
- JSubMenuHelper::addEntry(JText::_('ContMan_Link_Access_Control'), 'index.php?option=com_contentmanager&task=rule.display');
- // 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', $vName == 'templates');
- }
- }
- }