• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP JController类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中JController的典型用法代码示例。如果您正苦于以下问题:PHP JController类的具体用法?PHP JController怎么用?PHP JController使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了JController类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: display

 /**
  * Method to display a view.
  *
  * @param	boolean			If true, the view output will be cached
  * @param	array			An array of safe url parameters and their variable types, for valid values see {@link JFilterInput::clean()}.
  *
  * @return	JController		This object to support chaining.
  * @since	1.5
  */
 public function display($cachable = false, $urlparams = false)
 {
     require_once JPATH_COMPONENT . '/helpers/users.php';
     // Load the submenu.
     UsersHelper::addSubmenu(JRequest::getCmd('view', 'users'));
     $view = JRequest::getCmd('view', 'users');
     $layout = JRequest::getCmd('layout', 'default');
     $id = JRequest::getInt('id');
     if (!$this->canView($view)) {
         JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR'));
         return;
     }
     // Check for edit form.
     if ($view == 'user' && $layout == 'edit' && !$this->checkEditId('com_users.edit.user', $id)) {
         // Somehow the person just went to the form - we don't allow that.
         $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID', $id));
         $this->setMessage($this->getError(), 'error');
         $this->setRedirect(JRoute::_('index.php?option=com_users&view=users', false));
         return false;
     } elseif ($view == 'group' && $layout == 'edit' && !$this->checkEditId('com_users.edit.group', $id)) {
         // Somehow the person just went to the form - we don't allow that.
         $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID', $id));
         $this->setMessage($this->getError(), 'error');
         $this->setRedirect(JRoute::_('index.php?option=com_users&view=groups', false));
         return false;
     } elseif ($view == 'level' && $layout == 'edit' && !$this->checkEditId('com_users.edit.level', $id)) {
         // Somehow the person just went to the form - we don't allow that.
         $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID', $id));
         $this->setMessage($this->getError(), 'error');
         $this->setRedirect(JRoute::_('index.php?option=com_users&view=levels', false));
         return false;
     }
     return parent::display();
 }
开发者ID:Simarpreet05,项目名称:joomla,代码行数:43,代码来源:controller.php


示例2: display

 /**
  * Method to display a view.
  *
  * @param	boolean			If true, the view output will be cached
  * @param	array			An array of safe url parameters and their variable types, for valid values see {@link JFilterInput::clean()}.
  *
  * @return	JController		This object to support chaining.
  * @since	1.5
  */
 public function display($cachable = false, $urlparams = false)
 {
     $cachable = true;
     $safeurlparams = array('catid' => 'INT', 'id' => 'INT', 'cid' => 'ARRAY', 'year' => 'INT', 'month' => 'INT', 'limit' => 'INT', 'limitstart' => 'INT', 'showall' => 'INT', 'return' => 'BASE64', 'filter' => 'STRING', 'filter_order' => 'CMD', 'filter_order_Dir' => 'CMD', 'filter-search' => 'STRING', 'print' => 'BOOLEAN', 'lang' => 'CMD');
     parent::display($cachable, $safeurlparams);
     return $this;
 }
开发者ID:salomalo,项目名称:nbs-01,代码行数:16,代码来源:controller.php


示例3: __construct

 /**
  * Constructor.
  *
  * @param   array  $config  An optional associative array of configuration settings.
  *
  * @see     JController
  * @since   11.1
  * @throws  Exception
  */
 public function __construct($config = array())
 {
     parent::__construct($config);
     // Define standard task mappings.
     // Value = 0
     $this->registerTask('unpublish', 'publish');
     // Value = 2
     $this->registerTask('archive', 'publish');
     // Value = -2
     $this->registerTask('trash', 'publish');
     // Value = -3
     $this->registerTask('report', 'publish');
     $this->registerTask('orderup', 'reorder');
     $this->registerTask('orderdown', 'reorder');
     // Guess the option as com_NameOfController.
     if (empty($this->option)) {
         $this->option = 'com_' . strtolower($this->getName());
     }
     // Guess the JText message prefix. Defaults to the option.
     if (empty($this->text_prefix)) {
         $this->text_prefix = strtoupper($this->option);
     }
     // Guess the list view as the suffix, eg: OptionControllerSuffix.
     if (empty($this->view_list)) {
         $r = null;
         if (!preg_match('/(.*)Controller(.*)/i', get_class($this), $r)) {
             throw new Exception(JText::_('JLIB_APPLICATION_ERROR_CONTROLLER_GET_NAME'), 500);
         }
         $this->view_list = strtolower($r[2]);
     }
 }
开发者ID:nirmalgyanwali,项目名称:joomla-platform,代码行数:40,代码来源:admin.php


示例4: remove

 function remove()
 {
     $cid = JRequest::getVar('cid', array(), 'default', 'array');
     $id = JRequest::getInt('id');
     if (empty($id)) {
         if (!empty($cid) && is_array($cid)) {
             foreach ($cid as $id) {
                 $result = $this->_remove($id);
                 if (!$result) {
                     $this->setRedirect(JURI::base() . 'index.php?option=com_joomlapack&view=' . JRequest::getCmd('view') . '&tpl=' . JRequest::getCmd('tpl'), JText::_('FILTER_ERROR_INVALIDID'), 'error');
                     $this->redirect();
                     return;
                 }
             }
         } else {
             $this->setRedirect(JURI::base() . 'index.php?option=com_joomlapack&view=' . JRequest::getCmd('view') . '&tpl=' . JRequest::getCmd('tpl'), JText::_('FILTER_ERROR_INVALIDID'), 'error');
             $this->redirect();
             return;
         }
     } else {
         $result = $this->_remove($id);
         if (!$result) {
             $this->setRedirect(JURI::base() . 'index.php?option=com_joomlapack&view=' . JRequest::getCmd('view') . '&tpl=' . JRequest::getCmd('tpl'), $this->getError(), 'error');
             $this->redirect();
             return;
         }
     }
     $this->setRedirect(JURI::base() . 'index.php?option=com_joomlapack&view=' . JRequest::getCmd('view') . '&tpl=' . JRequest::getCmd('tpl'), JText::_('FILTER_MSG_DELETED'));
     parent::display();
 }
开发者ID:BackupTheBerlios,项目名称:kmit-svn,代码行数:30,代码来源:filtercontrollerparent.php


示例5: display

 /**
  * This method controlles the display methods
  */
 function display()
 {
     global $mainframe;
     switch ($this->getTask()) {
         case 'jucene_about':
             JRequest::setVar('hidemainmenu', 0);
             JRequest::setVar('layout', 'jucene_about');
             JRequest::setVar('view', 'jucene');
             break;
         case 'index':
             JRequest::setVar('hidemainmenu', 0);
             JRequest::setVar('layout', 'jucene_index');
             JRequest::setVar('view', 'jucene');
             $this->index();
             break;
         case 'continue':
             JRequest::setVar('hidemainmenu', 0);
             JRequest::setVar('layout', 'jucene_continue');
             JRequest::setVar('view', 'jucene');
             JRequest::setVar('edit', true);
             break;
         default:
             JRequest::setVar('hidemainmenu', 0);
             JRequest::setVar('layout', 'default');
             JRequest::setVar('view', 'jucene');
             JRequest::setVar('edit', true);
             break;
     }
     parent::display();
 }
开发者ID:KIZI,项目名称:sewebar-cms,代码行数:33,代码来源:controller.php


示例6: __construct

 public function __construct()
 {
     parent::__construct();
     $this->useSSL = VmConfig::get('useSSL', 0);
     $this->useXHTML = true;
     VmConfig::loadJLang('com_virtuemart_shoppers', TRUE);
 }
开发者ID:Roma48,项目名称:abazherka_old,代码行数:7,代码来源:user.php


示例7: array

 /**
  * Constructor
  */
 function __construct($config = array())
 {
     parent::__construct($config);
     // Register Extra tasks
     $this->registerTask('add', 'edit');
     $this->registerTask('apply', 'save');
 }
开发者ID:RangerWalt,项目名称:ecci,代码行数:10,代码来源:client.php


示例8: edit

 /**
  * display the edit form
  * @return void
  */
 function edit()
 {
     JRequest::setVar('view', 'company');
     JRequest::setVar('layout', 'form');
     JRequest::setVar('hidemainmenu', 1);
     parent::display();
 }
开发者ID:naka211,项目名称:designcreations1,代码行数:11,代码来源:companies.php


示例9: display

 function display($cachable = false, $urlparams = false)
 {
     switch (JRequest::getVar('task')) {
         case 'login':
             $this->LoginJUser();
             break;
         case 'create':
             $this->create_user();
             break;
         case 'create_proceed':
             $this->create_proceed();
             break;
         case 'logout':
             $this->logout();
             break;
         case 'switch':
             $this->distroy_fb_session();
             break;
         default:
             break;
     }
     switch (JRequest::getVar('view')) {
         default:
             JRequest::setVar('view', 'fbconnct');
     }
     parent::display();
 }
开发者ID:khangcodt,项目名称:nvssehcweb,代码行数:27,代码来源:controller.php


示例10: display

 function display()
 {
     $layout = JRequest::getVar('layout');
     JRequest::setVar('layout', $layout);
     JRequest::setVar('view', 'flex');
     parent::display();
 }
开发者ID:sangkasi,项目名称:joomla,代码行数:7,代码来源:flex.php


示例11: display

 /**
  * Display task
  */
 public function display($cachable = false)
 {
     // Set default view if not set
     JRequest::setVar('view', JRequest::getCmd('view', 'SocialLogin'));
     // Call parent behavior
     parent::display($cachable);
 }
开发者ID:basethic,项目名称:social-login-joomla,代码行数:10,代码来源:controller.php


示例12: display

 public function display($cachable = false, $urlparams = false)
 {
     if (JRequest::getCmd('option') != 'com_content' && JRequest::getCmd('view') != 'article') {
         JError::raiseError(403, 'Direct access to this component is unauthorized.');
     }
     return parent::display();
 }
开发者ID:rivetweb,项目名称:old-joomla-dd-countrymap,代码行数:7,代码来源:comments.php


示例13: display

 public function display()
 {
     // Only admin can use this function to invite guests
     $jxConfig = new JXConfig();
     $my = JXFactory::getUser();
     $mainframe = JFactory::getApplication();
     $accessHelper = new AccountAccessHelper();
     if (!$my->authorise('stream.setting.edit', $accessHelper)) {
         $mainframe->redirect(JURI::base(), JText::_('COM_ACCOUNT_ERRMSG_INVITATION_DENIED'), 'error');
     }
     if ($_POST) {
         jimport('joomla.utilities.xintegration');
         // Check if there is ad_integration posted and if the value is activedirectory
         // by comparing with xintegration library for supported integrations
         $adIntegration = JRequest::getString('ad_integration', '');
         if (!empty($adIntegration) && JXIntegration::isActiveDirectory($adIntegration)) {
             $integrationTbl = JTable::getInstance('integration', 'AccountTable');
             $integrationTbl->load(array('name' => $adIntegration));
             $integrationTbl->setParam('dc', JRequest::getString('ad_dc', ''));
             $integrationTbl->setParam('dm', JRequest::getString('ad_dm', ''));
             if (JRequest::getString('ad_pw', '') != '') {
                 $integrationTbl->setParam('pw', JRequest::getString('ad_pw', ''));
             }
             $integrationTbl->setParam('un', JRequest::getString('ad_un', ''));
             $integrationTbl->setParam('hi', JRequest::getString('ad_hi', ''));
             if (!$integrationTbl->store()) {
                 $mainframe->redirect(JRoute::_('index.php?option=com_account&view=integration'), $integrationTbl->getError(), 'error');
             }
             $mainframe->redirect(JRoute::_('index.php?option=com_account&view=integration'), JText::_('COM_ACCOUNT_ACTION_SAVE_INTEGRATION_SUCCESS!'));
         }
     }
     parent::display();
 }
开发者ID:ErickLopez76,项目名称:offiria,代码行数:33,代码来源:integration.php


示例14: display

 public function display($cachable = false, $urlparams = false)
 {
     // Load the submenu.
     $this->addSubmenu(JRequest::getWord('option', 'com_checkin'));
     parent::display();
     return $this;
 }
开发者ID:laiello,项目名称:senluonirvana,代码行数:7,代码来源:controller.php


示例15: display

 function display()
 {
     $view = JRequest::getCmd('view');
     $theme = JRequest::getVar('theme');
     switch ($view) {
         case 'imageslist':
             if (!empty($theme)) {
                 JRequest::setVar('layout', 'showcase');
             } else {
                 JRequest::setVar('layout', 'default');
             }
             JRequest::setVar('view', 'mediaimageslist');
             JRequest::setVar('model', 'mediaimageslist');
             break;
         default:
             if (!empty($theme)) {
                 JRequest::setVar('layout', 'showcase');
             } else {
                 JRequest::setVar('layout', 'default');
             }
             JRequest::setVar('view', 'media');
             JRequest::setVar('model', 'media');
             break;
     }
     parent::display();
 }
开发者ID:sangkasi,项目名称:joomla,代码行数:26,代码来源:media.php


示例16: display

 function display()
 {
     switch ($this->getTask()) {
         case 'add':
             JRequest::setVar('hidemainmenu', 1);
             JRequest::setVar('layout', 'form');
             JRequest::setVar('view', 'company');
             JRequest::setVar('edit', false);
             break;
         case 'edit':
             JRequest::setVar('hidemainmenu', 1);
             JRequest::setVar('layout', 'form');
             JRequest::setVar('view', 'company');
             JRequest::setVar('edit', true);
             break;
         case 'report':
             JRequest::setVar('hidemainmenu', 1);
             JRequest::setVar('layout', 'form');
             JRequest::setVar('view', 'report');
             JRequest::setVar('edit', false);
             break;
     }
     //Set the default view, just in case
     $view = JRequest::getCmd('view');
     if (empty($view)) {
         JRequest::setVar('view', 'companies');
     }
     parent::display();
 }
开发者ID:grlf,项目名称:eyedock,代码行数:29,代码来源:controller.php


示例17: display

	function display() {
        // Make sure we have a default view
        if( !JRequest::getVar( 'view' )) {
		    JRequest::setVar('view', 'myapi' );
        }
		parent::display();
	}
开发者ID:rhotog,项目名称:myApi,代码行数:7,代码来源:controller.php


示例18: edit

 public function edit()
 {
     JRequest::setVar('view', 'attributeprices_detail');
     JRequest::setVar('layout', 'default');
     JRequest::setVar('hidemainmenu', 1);
     parent::display();
 }
开发者ID:jaanusnurmoja,项目名称:redjoomla,代码行数:7,代码来源:attributeprices_detail.php


示例19: execute

 function execute($task)
 {
     if (file_exists(JPATH_COMPONENT_ADMINISTRATOR . DS . 'toolbar.countries.php')) {
         require JPATH_COMPONENT_ADMINISTRATOR . DS . 'toolbar.countries.php';
     }
     parent::execute($task);
 }
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:7,代码来源:countries.php


示例20: __construct

 public function __construct($default = array())
 {
     parent::__construct($default);
     // init vars
     $this->joomla = JFactory::getApplication();
     $this->user = JFactory::getUser();
     $this->session = JFactory::getSession();
     $this->document = JFactory::getDocument();
     $this->dispatcher = JDispatcher::getInstance();
     $this->option = YRequest::getCmd('option');
     $this->link_base = 'index.php?option=' . $this->option;
     $this->controller = $this->getName();
     // add super administrator var to user
     $this->user->superadmin = UserHelper::isJoomlaSuperAdmin($this->user);
     // init additional admin vars
     if ($this->joomla->isAdmin()) {
         $this->baseurl = 'index.php?option=' . $this->option . '&controller=' . $this->getName();
     }
     // init additional site vars
     if ($this->joomla->isSite()) {
         $this->itemid = (int) $GLOBALS['Itemid'];
         $this->params = $this->joomla->getParams();
         $this->pathway = $this->joomla->getPathway();
     }
 }
开发者ID:bizanto,项目名称:Hooked,代码行数:25,代码来源:controller.php



注:本文中的JController类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP JControllerAdmin类代码示例发布时间:2022-05-23
下一篇:
PHP JComponentHelper类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap