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

PHP Component\SiteController类代码示例

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

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



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

示例1: execute

 /**
  * Execute a task
  *
  * @return     void
  */
 public function execute()
 {
     $this->warehouse = new Warehouse();
     $user = User::getRoot();
     $this->warehouse->addAccessLevels($user->getAuthorisedViewLevels());
     // Get the task
     $this->_task = Request::getCmd('task', '');
     if (empty($this->_task)) {
         $this->_task = 'home';
         $this->registerTask('__default', $this->_task);
     }
     $executed = false;
     if (!method_exists($this, $this->_task . 'Task')) {
         // Try to find a corresponding collection
         $cId = $this->warehouse->collectionExists($this->_task);
         if ($cId) {
             // if match is found -- browse collection
             $executed = true;
             $this->browseCollection($cId);
         } else {
             App::abort(404, Lang::txt('Collection Not Found'));
         }
     }
     if (!$executed) {
         parent::execute();
     }
 }
开发者ID:mined-gatech,项目名称:hubzero-cms,代码行数:32,代码来源:browse.php


示例2: execute

 /**
  * Determines task being called and attempts to execute it
  *
  * @return  void
  */
 public function execute()
 {
     // Set configs
     $this->_setConfigs();
     // Incoming
     $this->_incoming();
     // Resource map
     if (strrpos(strtolower($this->_alias), '.rdf') > 0) {
         $this->_resourceMap();
         return;
     }
     // Set the default task
     $this->registerTask('__default', 'intro');
     // Register tasks
     $this->registerTask('view', 'page');
     $this->registerTask('download', 'serve');
     $this->registerTask('video', 'serve');
     $this->registerTask('play', 'serve');
     $this->registerTask('watch', 'serve');
     $this->registerTask('wiki', 'wikipage');
     $this->registerTask('submit', 'contribute');
     $this->registerTask('edit', 'contribute');
     $this->registerTask('start', 'contribute');
     $this->registerTask('publication', 'contribute');
     $this->_task = trim(Request::getVar('task', ''));
     if (($this->_id || $this->_alias) && !$this->_task) {
         $this->_task = 'page';
     } elseif (!$this->_task) {
         $this->_task = 'intro';
     }
     parent::execute();
 }
开发者ID:kevinwojo,项目名称:hubzero-cms,代码行数:37,代码来源:publications.php


示例3: execute

 /**
  * Execute a task
  *
  * @return     void
  */
 public function execute()
 {
     $this->gid = Request::getVar('gid', '');
     if (!$this->gid) {
         App::redirect('index.php?option=' . $this->_option);
         return;
     }
     // Load the course page
     $this->course = Models\Course::getInstance($this->gid);
     // Ensure we found the course info
     if (!$this->course->exists() || $this->course->isDeleted() || $this->course->isUnpublished()) {
         return App::abort(404, Lang::txt('COM_COURSES_NO_COURSE_FOUND'));
     }
     // No offering provided
     if (!($offering = Request::getVar('offering', ''))) {
         App::redirect(Route::url('index.php?option=' . $this->_option . '&controller=course&gid=' . $this->course->get('alias')));
         return;
     }
     // Ensure we found the course info
     if (!$this->course->offering($offering)->exists() || $this->course->offering($offering)->isDeleted() || !$this->course->offering($offering)->access('manage', 'section') && $this->course->offering($offering)->isUnpublished()) {
         return App::abort(404, Lang::txt('COM_COURSES_NO_OFFERING_FOUND'));
     }
     // Ensure the course has been published or has been approved
     if (!$this->course->offering()->access('manage', 'section') && !$this->course->isAvailable()) {
         return App::abort(404, Lang::txt('COM_COURSES_NOT_PUBLISHED'));
     }
     parent::execute();
 }
开发者ID:mined-gatech,项目名称:hubzero-cms,代码行数:33,代码来源:offering.php


示例4: execute

 /**
  * Execute a task
  *
  * @return  void
  */
 public function execute()
 {
     // Load the course page
     $this->course = Models\Course::getInstance(Request::getVar('gid', ''));
     $this->registerTask('edit', 'display');
     parent::execute();
 }
开发者ID:kevinwojo,项目名称:hubzero-cms,代码行数:12,代码来源:course.php


示例5: execute

 /**
  * Override execute method to init developer model
  * 
  * @return  void
  */
 public function execute()
 {
     // authorize application usage
     $this->_authorize('application', Request::getInt('id', null));
     // call parent execute
     parent::execute();
 }
开发者ID:kevinwojo,项目名称:hubzero-cms,代码行数:12,代码来源:applications.php


示例6: execute

 /**
  * Execute a task
  *
  * @return     void
  */
 public function execute()
 {
     $this->warehouse = new Warehouse();
     $user = User::getRoot();
     $this->warehouse->addAccessLevels($user->getAuthorisedViewLevels());
     parent::execute();
 }
开发者ID:mined-gatech,项目名称:hubzero-cms,代码行数:12,代码来源:product.php


示例7: execute

 /**
  * Execute function
  *
  * @return  void
  */
 public function execute()
 {
     // Is component on?
     if (!$this->config->get('component_on', 0)) {
         App::redirect('/');
         return;
     }
     // Publishing enabled?
     $this->_publishing = Plugin::isEnabled('projects', 'publications') ? 1 : 0;
     // Setup complete?
     $this->_setupComplete = $this->config->get('confirm_step', 0) ? 3 : 2;
     // Include scripts
     $this->_includeScripts();
     // Incoming project identifier
     $id = Request::getInt('id', 0);
     $alias = Request::getVar('alias', '');
     $this->_identifier = $id ? $id : $alias;
     // Incoming
     $this->_task = strtolower(Request::getWord('task', ''));
     $this->_gid = Request::getVar('gid', 0);
     // Model
     $this->model = new Models\Project($this->_identifier);
     // Execute the task
     parent::execute();
 }
开发者ID:kevinwojo,项目名称:hubzero-cms,代码行数:30,代码来源:base.php


示例8: execute

 /**
  * Execute a task
  *
  * @return     void
  */
 public function execute()
 {
     // Get the component parameters
     $aconfig = Component::params('com_answers');
     $this->infolink = $aconfig->get('infolink', '/kb/points/');
     parent::execute();
 }
开发者ID:kevinwojo,项目名称:hubzero-cms,代码行数:12,代码来源:shop.php


示例9: execute

 /**
  * Determines task being called and attempts to execute it
  *
  * @return  void
  */
 public function execute()
 {
     if (User::isGuest()) {
         App::abort(403, Lang::txt('COM_RESOURCES_ALERTLOGIN_REQUIRED'));
     }
     parent::execute();
 }
开发者ID:kevinwojo,项目名称:hubzero-cms,代码行数:12,代码来源:authors.php


示例10: __construct

 /**
  * Constructor
  *
  * @return  void
  */
 public function __construct()
 {
     // create our oauth server
     $this->server = new \Hubzero\Oauth\Server(new MysqlStorage());
     // do the rest of setup
     $this->disableDefaultTask();
     parent::__construct();
 }
开发者ID:mined-gatech,项目名称:hubzero-cms,代码行数:13,代码来源:oauth.php


示例11: execute

 /**
  * Execute a task
  *
  * @return	void
  */
 public function execute()
 {
     $this->model = new Manager('site', 0);
     $this->registerTask('latest', 'feed');
     $this->registerTask('latest', 'feed.rss');
     $this->registerTask('latest', 'latest.rss');
     parent::execute();
 }
开发者ID:mined-gatech,项目名称:hubzero-cms,代码行数:13,代码来源:threads.php


示例12: execute

 /**
  * Determines task being called and attempts to execute it
  *
  * @return     void
  */
 public function execute()
 {
     $this->_authorize();
     // Load the com_resources component config
     $rconfig = Component::params('com_resources');
     $this->rconfig = $rconfig;
     parent::execute();
 }
开发者ID:sumudinie,项目名称:hubzero-cms,代码行数:13,代码来源:attachments.php


示例13: execute

 /**
  * Determines task being called and attempts to execute it
  *
  * @return	void
  */
 public function execute()
 {
     $this->_authorize('collection');
     $this->_authorize('item');
     $this->registerTask('__default', 'posts');
     $this->registerTask('all', 'collections');
     parent::execute();
 }
开发者ID:mined-gatech,项目名称:hubzero-cms,代码行数:13,代码来源:collections.php


示例14: execute

 /**
  * Execute a task
  *
  * @return  void
  */
 public function execute()
 {
     $this->config->set('banking', \Component::params('com_members')->get('bankAccounts'));
     $this->registerTask('__default', 'search');
     $this->registerTask('display', 'search');
     $this->registerTask('latest', 'latest.rss');
     parent::execute();
 }
开发者ID:kevinwojo,项目名称:hubzero-cms,代码行数:13,代码来源:questions.php


示例15: execute

 /**
  * Determines task being called and attempts to execute it
  *
  * @return     void
  */
 public function execute()
 {
     // Check if they are logged in
     if (User::isGuest()) {
         App::abort(403, Lang::txt('You must be logged in to access.'));
         return;
     }
     parent::execute();
 }
开发者ID:mined-gatech,项目名称:hubzero-cms,代码行数:14,代码来源:attachments.php


示例16: execute

 /**
  * Execute a task
  *
  * @return  void
  */
 public function execute()
 {
     $parts = explode('/', $_SERVER['REQUEST_URI']);
     $file = array_pop($parts);
     if (substr(strtolower($file), 0, 5) == 'image' || substr(strtolower($file), 0, 4) == 'file') {
         Request::setVar('task', 'download');
     }
     parent::execute();
 }
开发者ID:mined-gatech,项目名称:hubzero-cms,代码行数:14,代码来源:media.php


示例17: execute

 /**
  * Override execute method to init developer model
  * 
  * @return  void
  */
 public function execute()
 {
     // create new developer model
     $this->developer = new Models\Developer();
     // authorize application usage
     $this->_authorize('application', Request::getInt('id', null));
     // call parent execute
     parent::execute();
 }
开发者ID:mined-gatech,项目名称:hubzero-cms,代码行数:14,代码来源:applications.php


示例18: execute

 /**
  * Execute a task
  *
  * @return  void
  */
 public function execute()
 {
     // disable default task - stop fallback when user enters bad task
     $this->disableDefaultTask();
     // register empty task and intro as the main display task
     $this->registerTask('', 'display');
     $this->registerTask('intro', 'display');
     // execute parent function
     parent::execute();
 }
开发者ID:kevinwojo,项目名称:hubzero-cms,代码行数:15,代码来源:citations.php


示例19: execute

 /**
  * Execute a task
  *
  * @return     void
  */
 public function execute()
 {
     $this->warehouse = new Warehouse();
     $this->warehouse->addAccessLevels(User::getAuthorisedViewLevels());
     $this->warehouse->addAccessGroups(User::getAuthorisedGroups());
     if (is_numeric(User::get('id'))) {
         $this->warehouse->addUserScope(User::get('id'));
     }
     parent::execute();
 }
开发者ID:kevinwojo,项目名称:hubzero-cms,代码行数:15,代码来源:product.php


示例20: execute

 /**
  * Override parent execute method
  *
  */
 public function execute()
 {
     //get request vars
     $this->id = Request::getInt('id', 0);
     //disable default task
     $this->disableDefaultTask();
     //register task when no newsletter is passed in
     $this->registerTask('', 'view');
     //call parent
     parent::execute();
 }
开发者ID:mined-gatech,项目名称:hubzero-cms,代码行数:15,代码来源:newsletter.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP User\Group类代码示例发布时间:2022-05-23
下一篇:
PHP Component\AdminController类代码示例发布时间: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