当前位置: 首页>>代码示例>>PHP>>正文


PHP loader::controller方法代码示例

本文整理汇总了PHP中loader::controller方法的典型用法代码示例。如果您正苦于以下问题:PHP loader::controller方法的具体用法?PHP loader::controller怎么用?PHP loader::controller使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在loader的用法示例。


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

示例1: getComments

 public static function getComments($resource, $userID, $itemID, $total, $privacy = 2, $post = true, $info = true, $static = false)
 {
     // Can we post comments?
     $post = $post && session::permission('comments_view', 'comments') && session::permission('comments_post', 'comments') ? true : false;
     if ($userID) {
         $post = $privacy && codebreeder::instance()->users_model->getPrivacyAccess($userID, $privacy, false) ? true : false;
     }
     loader::controller('comments');
     echo codebreeder::instance()->comments->browse($resource, $itemID, $total, 1, $post, $info, $static);
 }
开发者ID:soremi,项目名称:tutornavi,代码行数:10,代码来源:comments.php

示例2: index

 public function index()
 {
     // Load banner groups by default
     if (!uri::segment(5)) {
         loader::controller('cp/content/banners/groups', array(), 'banners_groups');
         $this->banners_groups->index();
         return;
     }
     $this->browse();
 }
开发者ID:soremi,项目名称:tutornavi,代码行数:10,代码来源:banners.php

示例3: index

 public function index()
 {
     if (session::permission('users_manage', 'users')) {
         loader::controller('cp/users');
         $this->users->browse();
     } else {
         view::noAccess(false);
         // Load view
         view::load('cp/home');
     }
 }
开发者ID:soremi,项目名称:tutornavi,代码行数:11,代码来源:home.php

示例4: home

 public function home()
 {
     if (users_helper::isLoggedin()) {
         if (config::item('homepage_user', 'users') == 'profile') {
             loader::controller('users/profile', array(), 'users_profile');
             $this->users_profile->manage();
             return;
         } elseif (config::item('homepage_user', 'users') == 'timeline_public') {
             loader::controller('timeline', array(), 'timeline');
             $this->timeline->browse();
             return;
         } elseif (config::item('homepage_user', 'users') == 'timeline_user') {
             loader::controller('timeline', array(), 'timeline');
             $this->timeline->manage();
             return;
         }
     } elseif (config::item('homepage_public', 'users') == 'timeline_public') {
         loader::controller('timeline', array(), 'timeline');
         $this->timeline->browse();
         return;
     }
     // Set meta tags
     $this->metatags_model->set('system', 'site_index', array(), false);
     view::load('home');
 }
开发者ID:soremi,项目名称:tutornavi,代码行数:25,代码来源:pages.php

示例5: manage

 public function manage()
 {
     // Is user loggedin ?
     if (!users_helper::isLoggedin()) {
         router::redirect('users/login');
     } elseif (!session::permission('pictures_post', 'pictures')) {
         view::noAccess(session::item('slug'));
     }
     // Get URI vars
     $albumID = (int) uri::segment(3);
     if (!$albumID) {
         loader::controller('pictures/albums', array(), 'pictures_albums');
         $this->pictures_albums->manage();
         return;
     }
     // Assign user from session to variable
     $user = session::section('session');
     // Get album
     if (!($album = $this->pictures_albums_model->getAlbum($albumID, 'in_view')) || session::item('user_id') != $album['user_id']) {
         view::setError(__('no_album', 'pictures'));
         router::redirect('pictures');
     }
     // Does album have any pictures?
     if ($album['total_pictures'] + $album['total_pictures_i'] == 0) {
         view::setInfo(__('no_pictures_album', 'pictures'));
         router::redirect('pictures/index/' . $albumID . '/' . text_helper::slug($album['data_title'], 100));
     }
     // Get fields
     $fields = $this->fields_model->getFields('pictures', 0, 'edit', 'in_account');
     foreach ($fields as $index => $field) {
         if ($field['keyword'] != 'description') {
             unset($fields[$index]);
         }
     }
     // Parameters
     $params = array('join_columns' => array('`p`.`album_id`=' . $albumID), 'join_items' => array(), 'total' => $album['total_pictures'] + $album['total_pictures_i']);
     // Process query string
     $qstring = $this->parseQuerystring();
     // Get pictures
     $pictures = $this->pictures_model->getPictures('in_account', $params['join_columns'], $params['join_items'], $qstring['order'], $album['total_pictures'] + $album['total_pictures_i'], array('escape' => false, 'parse' => false, 'select_users' => false));
     // Assign vars
     view::assign(array('albumID' => $albumID, 'user' => $user, 'album' => $album, 'fields' => $fields, 'pictures' => $pictures));
     // Process form values
     if (input::post('do_save_pictures')) {
         $this->_savePictures($albumID, $pictures, $album, $fields);
     }
     // Set title
     view::setTitle(__('pictures_organize', 'pictures'));
     // Set trail
     view::setTrail(session::item('slug'), __('my_profile', 'system_navigation'));
     view::setTrail('pictures/manage', __('pictures_albums', 'system_navigation'));
     view::setTrail('pictures/index/' . $album['album_id'] . '/' . text_helper::slug($album['data_title'], 100), __('album_view', 'pictures'), array('side' => true));
     // Load view
     view::load('pictures/manage');
 }
开发者ID:soremi,项目名称:tutornavi,代码行数:55,代码来源:pictures.php

示例6: settings

 public function settings()
 {
     // Get URI vars
     $keyword = uri::segment(5);
     // Get plugin
     if (!$keyword || !($plugin = $this->plugins_model->getPlugin($keyword))) {
         view::setError(__('no_plugin', 'system_plugins'));
         router::redirect('cp/system/plugins');
     }
     // Do we have settings enabled?
     if (!$plugin['settings']) {
         view::setError(__('no_plugin_settings', 'system_plugins'));
         router::redirect('cp/system/plugins');
     }
     // Assign vars
     view::assign(array('plugin' => $plugin));
     // Set title
     view::setTitle(__('plugin_settings', 'system_plugins'));
     // Set trail
     view::setTrail('cp/system/plugins/view/' . $keyword, __('plugin_view', 'system_plugins') . ' - ' . $plugin['name']);
     // Load settings controller
     loader::controller('cp/system/config/system', array(), 'system_settings');
     codebreeder::instance()->controller->system_settings->browse($keyword);
 }
开发者ID:soremi,项目名称:tutornavi,代码行数:24,代码来源:plugins.php


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