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


PHP text_helper::truncate方法代码示例

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


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

示例1: browse

 public function browse()
 {
     // Parameters
     $params = array('join_columns' => array(), 'join_items' => array());
     // Process filters
     $params = $this->parseCounters($params);
     // Process query string
     $qstring = $this->parseQuerystring($params['total']);
     // Actions
     $actions = array(0 => __('select', 'system'), 'approve' => __('approve', 'system'), 'decline' => __('decline', 'system'), 'delete' => __('delete', 'system'));
     // Check form action
     if (input::post('do_action')) {
         // Delete selected blogs
         if (input::post('action') && isset($actions[input::post('action')]) && input::post('blog_id') && is_array(input::post('blog_id'))) {
             foreach (input::post('blog_id') as $blogID) {
                 $blogID = (int) $blogID;
                 if ($blogID && $blogID > 0) {
                     $this->action(input::post('action'), $blogID);
                 }
             }
         }
         // Success
         view::setInfo(__('action_applied', 'system'));
         router::redirect('cp/plugins/blogs?' . $qstring['url'] . 'page=' . $qstring['page']);
     }
     // Get blogs
     $blogs = array();
     if ($params['total']) {
         $blogs = $this->blogs_model->getBlogs('in_list', $params['join_columns'], $params['join_items'], $qstring['order'], $qstring['limit']);
     }
     // Create table grid
     $grid = array('uri' => 'cp/plugins/blogs', 'keyword' => 'blogs', 'header' => array('check' => array('html' => 'blog_id', 'class' => 'check'), 'data_title' => array('html' => __('name', 'system'), 'class' => 'name', 'sortable' => true), 'user' => array('html' => __('user', 'system'), 'class' => 'user'), 'post_date' => array('html' => __('post_date', 'system'), 'class' => 'date', 'sortable' => true), 'status' => array('html' => __('status', 'system'), 'class' => 'status'), 'actions' => array('html' => __('actions', 'system'), 'class' => 'actions')), 'content' => array());
     // Create grid content
     foreach ($blogs as $blog) {
         if ($blog['active'] == 1) {
             $status = html_helper::anchor('cp/plugins/blogs/decline/' . $blog['blog_id'] . '?' . $qstring['url'] . 'page=' . $qstring['page'], __('active', 'system'), array('class' => 'label small success'));
         } else {
             $status = html_helper::anchor('cp/plugins/blogs/approve/' . $blog['blog_id'] . '?' . $qstring['url'] . 'page=' . $qstring['page'], $blog['active'] ? __('pending', 'system') : __('inactive', 'system'), array('class' => 'label small ' . ($blog['active'] ? 'info' : 'important')));
         }
         $grid['content'][] = array('check' => array('html' => $blog['blog_id']), 'data_title' => array('html' => html_helper::anchor('cp/plugins/blogs/edit/' . $blog['blog_id'], text_helper::truncate($blog['data_title'], 64))), 'user' => array('html' => users_helper::anchor($blog['user'])), 'post_date' => array('html' => date_helper::formatDate($blog['post_date'])), 'status' => array('html' => $status), 'actions' => array('html' => array('edit' => html_helper::anchor('cp/plugins/blogs/edit/' . $blog['blog_id'], __('edit', 'system'), array('class' => 'edit')), 'delete' => html_helper::anchor('cp/plugins/blogs/delete/' . $blog['blog_id'] . '?' . $qstring['url'] . 'page=' . $qstring['page'], __('delete', 'system'), array('data-html' => __('blog_delete?', 'blogs'), 'data-role' => 'confirm', 'class' => 'delete')))));
     }
     // Set pagination
     $config = array('base_url' => config::siteURL('cp/plugins/blogs?' . $qstring['url']), 'total_items' => $params['total'], 'items_per_page' => $this->blogsPerPage, 'current_page' => $qstring['page'], 'uri_segment' => 'page');
     $pagination = loader::library('pagination', $config, null);
     // Filter hooks
     hook::filter('cp/plugins/blogs/browse/grid', $grid);
     hook::filter('cp/plugins/blogs/browse/actions', $actions);
     // Assign vars
     view::assign(array('grid' => $grid, 'actions' => $actions, 'pagination' => $pagination));
     // Set title
     view::setTitle(__('blogs_manage', 'system_navigation'));
     // Set trail
     if ($qstring['search_id']) {
         view::setTrail('cp/plugins/blogs?' . $qstring['url'] . 'page=' . $qstring['page'], __('search_results', 'system'));
     }
     // Assign actions
     view::setAction('#', __('search', 'system'), array('class' => 'icon-text icon-system-search', 'onclick' => '$(\'#blogs-search\').toggle();return false;'));
     // Load view
     view::load('cp/plugins/blogs/browse');
 }
开发者ID:soremi,项目名称:tutornavi,代码行数:60,代码来源:blogs.php

示例2: browse

 public function browse()
 {
     // Get URI vars
     $groupID = (int) uri::segment(5);
     // Get group
     if (!$groupID || !($group = $this->banners_groups_model->getGroup($groupID))) {
         view::setError(__('no_group', 'banners'));
         router::redirect('cp/content/banners/groups');
     }
     // Process query string
     $params = $this->parseQuerystring();
     // Get banners
     if (!($banners = $this->banners_model->getBanners($groupID, $params))) {
         view::setInfo(__('no_banners', 'banners'));
     }
     // Create table grid
     $grid = array('uri' => 'cp/content/banners/browse/' . $groupID, 'keyword' => 'banners', 'header' => array('name' => array('html' => __('name', 'system'), 'class' => 'name', 'sortable' => true), 'total_views' => array('html' => __('banner_views', 'banners'), 'class' => 'views', 'sortable' => true), 'total_clicks' => array('html' => __('banner_clicks', 'banners'), 'class' => 'clicks', 'sortable' => true), 'status' => array('html' => __('active', 'system'), 'class' => 'status'), 'actions' => array('html' => __('actions', 'system'), 'class' => 'actions')), 'content' => array());
     // Create grid content
     foreach ($banners as $banner) {
         $grid['content'][] = array('name' => array('html' => html_helper::anchor('cp/content/banners/edit/' . $groupID . '/' . $banner['banner_id'], text_helper::truncate(text_helper::entities($banner['name']), 64))), 'total_views' => array('html' => $banner['total_views']), 'total_clicks' => array('html' => $banner['total_clicks']), 'status' => array('html' => $banner['active'] ? '<span class="label success small">' . __('yes', 'system') . '</span>' : '<span class="label important small">' . __('no', 'system') . '</span>'), 'actions' => array('html' => array('edit' => html_helper::anchor('cp/content/banners/edit/' . $groupID . '/' . $banner['banner_id'], __('edit', 'system'), array('class' => 'edit')), 'delete' => html_helper::anchor('cp/content/banners/delete/' . $groupID . '/' . $banner['banner_id'], __('delete', 'system'), array('data-html' => __('banner_delete?', 'banners'), 'data-role' => 'confirm', 'class' => 'delete')))));
     }
     // Filter hooks
     hook::filter('cp/content/banners/browse/grid', $grid);
     // Assign vars
     view::assign(array('grid' => $grid));
     // Set title
     view::setTitle(__('banners_manage', 'system_navigation'));
     // Set trail
     view::setTrail('cp/content/banners/groups/edit/' . $groupID, __('group_edit', 'banners') . ' - ' . text_helper::entities($group['name']));
     view::setTrail('cp/content/banners/browse/' . $groupID, __('banners', 'banners'));
     // Assign actions
     view::setAction('cp/content/banners/edit/' . $groupID, __('banner_new', 'banners'), array('class' => 'icon-text icon-banners-new'));
     // Load view
     view::load('cp/content/banners/browse');
 }
开发者ID:soremi,项目名称:tutornavi,代码行数:35,代码来源:banners.php

示例3: browse

 public function browse()
 {
     // Parameters
     $params = array('join_columns' => array(), 'join_items' => array());
     // Process filters
     $params = $this->parseCounters($params);
     // Process query string
     $qstring = $this->parseQuerystring($params['total']);
     // Actions
     $actions = array(0 => __('select', 'system'), 'delete' => __('delete', 'system'));
     // Check form action
     if (input::post('do_action')) {
         // Delete selected news
         if (input::post('action') == 'delete') {
             if (input::post('news_id') && is_array(input::post('news_id'))) {
                 foreach (input::post('news_id') as $newsID) {
                     $newsID = (int) $newsID;
                     if ($newsID && $newsID > 0) {
                         $this->delete($newsID);
                     }
                 }
             }
         }
         // Success
         view::setInfo(__('action_applied', 'system'));
         router::redirect('cp/content/news?' . $qstring['url'] . 'page=' . $qstring['page']);
     }
     // Get news
     $news = array();
     if ($params['total']) {
         $news = $this->news_model->getEntries('in_list', $params['join_columns'], $params['join_items'], $qstring['order'], $qstring['limit']);
     }
     // Create table grid
     $grid = array('uri' => 'cp/content/news', 'keyword' => 'news', 'header' => array('check' => array('html' => 'news_id', 'class' => 'check'), 'data_title_' . session::item('language') => array('html' => __('name', 'system'), 'class' => 'name', 'sortable' => true), 'post_date' => array('html' => __('post_date', 'system'), 'class' => 'date', 'sortable' => true), 'status' => array('html' => __('status', 'system'), 'class' => 'status'), 'actions' => array('html' => __('actions', 'system'), 'class' => 'actions')), 'content' => array());
     // Create grid content
     foreach ($news as $entry) {
         $grid['content'][] = array('check' => array('html' => $entry['news_id']), 'data_title_' . session::item('language') => array('html' => html_helper::anchor('cp/content/news/edit/' . $entry['news_id'], text_helper::truncate($entry['data_title'], 64))), 'post_date' => array('html' => date_helper::formatDate($entry['post_date'])), 'status' => array('html' => $entry['active'] ? '<span class="label success small">' . __('yes', 'system') . '</span>' : '<span class="label important small">' . __('no', 'system') . '</span>'), 'actions' => array('html' => array('edit' => html_helper::anchor('cp/content/news/edit/' . $entry['news_id'], __('edit', 'system'), array('class' => 'edit')), 'delete' => html_helper::anchor('cp/content/news/delete/' . $entry['news_id'] . '?' . $qstring['url'] . 'page=' . $qstring['page'], __('delete', 'system'), array('data-html' => __('entry_delete?', 'news'), 'data-role' => 'confirm', 'class' => 'delete')))));
     }
     // Set pagination
     $config = array('base_url' => config::siteURL('cp/content/news?' . $qstring['url']), 'total_items' => $params['total'], 'items_per_page' => $this->newsPerPage, 'current_page' => $qstring['page'], 'uri_segment' => 'page');
     $pagination = loader::library('pagination', $config, null);
     // Filter hooks
     hook::filter('cp/content/news/browse/grid', $grid);
     hook::filter('cp/content/news/browse/actions', $actions);
     // Assign vars
     view::assign(array('grid' => $grid, 'actions' => $actions, 'pagination' => $pagination));
     // Set title
     view::setTitle(__('news_manage', 'system_navigation'));
     // Set trail
     if ($qstring['search_id']) {
         view::setTrail('cp/content/news?' . $qstring['url'] . 'page=' . $qstring['page'], __('search_results', 'system'));
     }
     // Assign actions
     view::setAction('cp/content/news/edit/', __('entry_new', 'news'), array('class' => 'icon-text icon-news-new'));
     view::setAction('#', __('search', 'system'), array('class' => 'icon-text icon-system-search', 'onclick' => '$(\'#news-search\').toggle();return false;'));
     // Load view
     view::load('cp/content/news/browse');
 }
开发者ID:soremi,项目名称:tutornavi,代码行数:58,代码来源:news.php

示例4: browse

 public function browse()
 {
     // Parameters
     $params = array('join_columns' => array());
     // Process filters
     $params = $this->parseCounters($params);
     // Process query string
     $qstring = $this->parseQuerystring($params['total']);
     // Actions
     $actions = array(0 => __('select', 'system'), 'delete' => __('delete', 'system'));
     // Check form action
     if (input::post('do_action')) {
         // Delete selected messages
         if (input::post('action') == 'delete') {
             if (input::post('message_id') && is_array(input::post('message_id'))) {
                 foreach (input::post('message_id') as $messageID) {
                     $messageID = (int) $messageID;
                     if ($messageID && $messageID > 0) {
                         $this->delete($messageID);
                     }
                 }
             }
         }
         // Success
         view::setInfo(__('action_applied', 'system'));
         router::redirect('cp/plugins/messages?' . $qstring['url'] . 'page=' . $qstring['page']);
     }
     // Get messages
     $messages = array();
     if ($params['total']) {
         $messages = $this->messages_model->getMessages($params['join_columns'], $qstring['order'], $qstring['limit']);
     }
     // Create table grid
     $grid = array('uri' => 'cp/plugins/messages', 'keyword' => 'messages', 'header' => array('check' => array('html' => 'message_id', 'class' => 'check'), 'message' => array('html' => __('message', 'messages'), 'class' => 'name'), 'user' => array('html' => __('user', 'system'), 'class' => 'user'), 'post_date' => array('html' => __('post_date', 'system'), 'class' => 'date', 'sortable' => true), 'actions' => array('html' => __('actions', 'system'), 'class' => 'actions')), 'content' => array());
     // Create grid content
     foreach ($messages as $message) {
         $grid['content'][] = array('check' => array('html' => $message['message_id']), 'message' => array('html' => html_helper::anchor('cp/plugins/messages/edit/' . $message['message_id'], text_helper::truncate($message['message'], 64))), 'user' => array('html' => users_helper::anchor($message['user'])), 'post_date' => array('html' => date_helper::formatDate($message['post_date'])), 'actions' => array('html' => array('edit' => html_helper::anchor('cp/plugins/messages/edit/' . $message['message_id'], __('edit', 'system'), array('class' => 'edit')), 'delete' => html_helper::anchor('cp/plugins/messages/delete/' . $message['message_id'] . '?' . $qstring['url'] . 'page=' . $qstring['page'], __('delete', 'system'), array('data-html' => __('message_delete?', 'messages'), 'data-role' => 'confirm', 'class' => 'delete')))));
     }
     // Set pagination
     $config = array('base_url' => config::siteURL('cp/plugins/messages?' . $qstring['url']), 'total_items' => $params['total'], 'items_per_page' => $this->messagesPerPage, 'current_page' => $qstring['page'], 'uri_segment' => 'page');
     $pagination = loader::library('pagination', $config, null);
     // Filter hooks
     hook::filter('cp/plugins/messages/browse/grid', $grid);
     hook::filter('cp/plugins/messages/browse/actions', $actions);
     // Assign vars
     view::assign(array('grid' => $grid, 'actions' => $actions, 'pagination' => $pagination));
     // Set title
     view::setTitle(__('messages_manage', 'system_navigation'));
     // Set trail
     if ($qstring['search_id']) {
         view::setTrail('cp/plugins/messages?' . $qstring['url'] . 'page=' . $qstring['page'], __('search_results', 'system'));
     }
     // Assign actions
     view::setAction('#', __('search', 'system'), array('class' => 'icon-text icon-system-search', 'onclick' => '$(\'#messages-search\').toggle();return false;'));
     // Load view
     view::load('cp/plugins/messages/browse');
 }
开发者ID:soremi,项目名称:tutornavi,代码行数:57,代码来源:messages.php

示例5: browse

 public function browse()
 {
     // Get URI vars
     $parentID = (int) uri::segment(5);
     // Get parent pages
     $parents = $parentID ? $this->pages_model->getParents($parentID) : array();
     if ($parentID && !$parents) {
         view::setError(__('no_parent', 'pages'));
         router::redirect('cp/content/pages');
     }
     // Parameters
     $params = array('join_columns' => array("`p`.`parent_id`=" . (int) $parentID), 'join_items' => array());
     // Process query string
     $qstring = $this->parseQuerystring();
     // Check form action
     if (input::post('do_action')) {
         // Delete selected pages
         if (input::post('action') == 'delete') {
             if (input::post('page_id') && is_array(input::post('page_id'))) {
                 foreach (input::post('page_id') as $pageID) {
                     $pageID = (int) $pageID;
                     if ($pageID && $pageID > 0) {
                         $this->delete($parentID, $pageID);
                     }
                 }
             }
         }
         // Success
         view::setInfo(__('action_applied', 'system'));
         router::redirect('cp/content/pages/browse/' . $parentID . ($qstring['url'] ? '?' . $qstring['url'] : ''));
     }
     // Get pages
     if (!($pages = $this->pages_model->getPages($parentID, 'in_list', $params['join_columns'], $params['join_items'], $qstring['order']))) {
         view::setError(__('no_pages', 'pages'));
     }
     // Create table grid
     $grid = array('uri' => 'cp/content/pages/browse/' . $parentID, 'keyword' => 'pages', 'header' => array('check' => array('html' => 'page_id', 'class' => 'check'), 'data_title_' . session::item('language') => array('html' => __('name', 'system'), 'class' => 'name', 'sortable' => true), 'status' => array('html' => __('status', 'system'), 'class' => 'status'), 'actions' => array('html' => __('actions', 'system'), 'class' => 'actions')), 'content' => array());
     // Create grid content
     foreach ($pages as $page) {
         $grid['content'][] = array('check' => array('html' => $page['page_id']), 'data_title_' . session::item('language') => array('html' => html_helper::anchor('cp/content/pages/edit/' . $page['parent_id'] . '/' . $page['page_id'], text_helper::truncate($page['data_title'], 64))), 'status' => array('html' => $page['active'] ? '<span class="label success small">' . __('active', 'system') . '</span>' : '<span class="label important small">' . __('inactive', 'system') . '</span>'), 'actions' => array('html' => array('pages' => html_helper::anchor('cp/content/pages/browse/' . $page['page_id'], __('page_inner', 'pages'), array('class' => 'pages')), 'edit' => html_helper::anchor('cp/content/pages/edit/' . $page['parent_id'] . '/' . $page['page_id'], __('edit', 'system'), array('class' => 'edit')), 'delete' => html_helper::anchor('cp/content/pages/delete/' . $page['parent_id'] . '/' . $page['page_id'] . '?' . $qstring['url'], __('delete', 'system'), array('data-html' => __('page_delete?', 'pages'), 'data-role' => 'confirm', 'class' => 'delete')))));
     }
     // Create actions
     $actions = array(0 => __('select', 'system'), 'delete' => __('delete', 'system'));
     // Assign vars
     view::assign(array('grid' => $grid, 'actions' => $actions));
     // Set title
     view::setTitle(__('pages_manage', 'system_navigation'));
     // Set trail
     view::setTrail('cp/content/pages/browse', __('pages', 'pages'));
     foreach ($parents as $parent) {
         view::setTrail('cp/content/pages/edit/' . $parent['parent_id'] . '/' . $parent['page_id'], $parent['data_title']);
     }
     // Assign actions
     view::setAction('cp/content/pages/edit/' . $parentID, __('page_new', 'pages'), array('class' => 'icon-text icon-pages-new'));
     // Load view
     view::load('cp/content/pages/browse');
 }
开发者ID:soremi,项目名称:tutornavi,代码行数:57,代码来源:pages.php

示例6: index

 public function index()
 {
     // Get plugins
     if (!($plugins = $this->plugins_model->scanPlugins())) {
         view::setError(__('no_plugins', 'system_plugins'));
         router::redirect('cp/system/config/system');
     }
     // Create table grid
     $grid = array('uri' => 'cp/system/plugins', 'keyword' => 'plugins', 'header' => array('name' => array('html' => __('name', 'system'), 'class' => 'name'), 'description' => array('html' => __('description', 'system'), 'class' => 'text'), 'version' => array('html' => __('plugin_version', 'system_plugins'), 'class' => 'version'), 'author' => array('html' => __('plugin_author', 'system_plugins'), 'class' => 'author'), 'actions' => array('html' => __('actions', 'system'), 'class' => 'actions')), 'content' => array());
     // Create grid content
     foreach ($plugins as $plugin) {
         $version = $plugin['version'] != '' ? $plugin['version'] : '1.0.0';
         if (isset($plugin['plugin_id']) && $plugin['plugin_id'] && version_compare($plugin['version_new'], $plugin['version']) == 1) {
             $version .= ' ' . html_helper::anchor('cp/system/plugins/view/' . $plugin['keyword'], '+', array('class' => 'label success small', 'title' => __('plugin_new_version', 'system_plugins', array('%version' => text_helper::entities($plugin['version_new'])))));
         }
         $author = '';
         if ($plugin['author'] || $plugin['website']) {
             if ($plugin['author'] && $plugin['website']) {
                 $author = html_helper::anchor($plugin['website'], $plugin['author'], array('target' => '_blank'));
             } elseif ($plugin['website']) {
                 $author = html_helper::anchor($plugin['website'], text_helper::entities(str_ireplace(array('http://www.', 'http://'), '', $plugin['website'])), array('target' => '_blank'));
             } elseif ($plugin['author']) {
                 $author = $plugin['author'];
             }
         }
         $actions = array();
         if (isset($plugin['plugin_id']) && $plugin['plugin_id']) {
             if ($plugin['settings']) {
                 $actions['html']['settings'] = html_helper::anchor('cp/system/plugins/settings/' . $plugin['keyword'], __('settings', 'system'), array('class' => 'settings'));
             } else {
                 $actions['html']['view'] = html_helper::anchor('cp/system/plugins/view/' . $plugin['keyword'], __('details', 'system'), array('class' => 'details'));
             }
             if (!isset($plugin['system']) || !$plugin['system']) {
                 $actions['html']['uninstall'] = html_helper::anchor('cp/system/plugins/uninstall/' . $plugin['keyword'], __('uninstall', 'system'), array('data-html' => __('plugin_uninstall?', 'system_plugins'), 'data-role' => 'confirm', 'class' => 'uninstall'));
             }
         } else {
             $actions['html']['install'] = html_helper::anchor('cp/system/plugins/install/' . $plugin['keyword'], __('install', 'system'), array('class' => 'install'));
         }
         $grid['content'][] = array('name' => array('html' => html_helper::anchor('cp/system/plugins/view/' . $plugin['keyword'], $plugin['name'])), 'description' => array('html' => text_helper::truncate($plugin['description'], 64)), 'version' => array('html' => $version), 'author' => array('html' => $author), 'actions' => $actions);
     }
     // Filter hooks
     hook::filter('cp/system/plugins/browse/grid', $grid);
     // Assign vars
     view::assign(array('grid' => $grid));
     // Set title
     view::setTitle(__('system_plugins_manage', 'system_navigation'));
     // Load view
     view::load('cp/system/plugins/browse');
 }
开发者ID:soremi,项目名称:tutornavi,代码行数:49,代码来源:plugins.php

示例7: browse

 public function browse()
 {
     // Get user types
     $types = $this->users_types_model->getTypes();
     // Create table grid
     $grid = array('uri' => 'cp/users/types/browse', 'keyword' => 'userstypes', 'header' => array('name' => array('html' => __('name', 'system'), 'class' => 'name'), 'actions' => array('html' => __('actions', 'system'), 'class' => 'actions')), 'content' => array());
     // Create grid content
     foreach ($types as $type) {
         $grid['content'][] = array('name' => array('html' => html_helper::anchor('cp/users/types/edit/' . $type['type_id'], text_helper::truncate($type['name'], 64))), 'actions' => array('html' => array('questions' => html_helper::anchor('cp/system/fields/users/browse/' . $type['type_id'], __('profile_questions', 'users_types'), array('class' => 'questions')), 'edit' => html_helper::anchor('cp/users/types/edit/' . $type['type_id'], __('edit', 'system'), array('class' => 'edit')), 'delete' => html_helper::anchor('cp/users/types/delete/' . $type['type_id'], __('delete', 'system'), array('data-html' => __('type_delete?', 'users_types'), 'data-role' => 'confirm', 'class' => 'delete')))));
     }
     // Filter hooks
     hook::filter('cp/users/types/browse/grid', $grid);
     // Assign vars
     view::assign(array('grid' => $grid));
     // Set title
     view::setTitle(__('users_types_manage', 'system_navigation'));
     // Assign actions
     view::setAction('cp/users/types/edit', __('type_new', 'users_types'), array('class' => 'icon-text icon-users-types-new'));
     // Load view
     view::load('cp/users/types/browse');
 }
开发者ID:soremi,项目名称:tutornavi,代码行数:21,代码来源:types.php

示例8: browse

 public function browse()
 {
     // Actions
     $actions = array(0 => __('select', 'system'), 'permissions' => __('permissions_edit', 'users_groups'));
     // Check form action
     if (input::post('do_action')) {
         if (input::post('action') && isset($actions[input::post('action')]) && input::post('group_id') && is_array(input::post('group_id'))) {
             $groups = input::post('group_id');
             if (isset($groups[0]) && !$groups[0]) {
                 unset($groups[0]);
             }
             if (count($groups) > 5) {
                 view::setError(__('groups_select_limit', 'users_groups', array('%groups' => 5)));
             } else {
                 router::redirect('cp/users/groups/plugins/' . implode(',', $groups));
             }
         }
         router::redirect('cp/users/groups');
     }
     // Get user groups
     $groups = $this->users_groups_model->getGroups();
     // Create table grid
     $grid = array('uri' => 'cp/users/groups/browse', 'keyword' => 'usersgroups', 'header' => array('check' => array('html' => 'group_id', 'class' => 'check'), 'name' => array('html' => __('name', 'system'), 'class' => 'name'), 'actions' => array('html' => __('actions', 'system'), 'class' => 'actions')), 'content' => array());
     // Create grid content
     foreach ($groups as $group) {
         $grid['content'][] = array('check' => array('html' => $group['group_id']), 'name' => array('html' => html_helper::anchor('cp/users/groups/edit/' . $group['group_id'], text_helper::truncate($group['name'], 64))), 'actions' => array('html' => array('permissions' => html_helper::anchor('cp/users/groups/plugins/' . $group['group_id'], __('permissions', 'users_permissions'), array('class' => 'permissions')), 'edit' => html_helper::anchor('cp/users/groups/edit/' . $group['group_id'], __('edit', 'system'), array('class' => 'edit')), 'delete' => html_helper::anchor('cp/users/groups/delete/' . $group['group_id'], __('delete', 'system'), array('data-html' => __('group_delete?', 'users_groups'), 'data-role' => 'confirm', 'class' => 'delete')))));
     }
     // Filter hooks
     hook::filter('cp/users/groups/browse/grid', $grid);
     // Assign vars
     view::assign(array('grid' => $grid, 'actions' => $actions));
     // Set title
     view::setTitle(__('users_groups_manage', 'system_navigation'));
     // Assign actions
     view::setAction('cp/users/groups/edit', __('group_new', 'users_groups'), array('class' => 'icon-text icon-users-groups-new'));
     // Load view
     view::load('cp/users/groups/browse');
 }
开发者ID:soremi,项目名称:tutornavi,代码行数:38,代码来源:groups.php

示例9: browse

 public function browse()
 {
     // Get banner groups
     if (!($groups = $this->banners_groups_model->getGroups())) {
         view::setInfo(__('no_groups', 'banners'));
     }
     // Create table grid
     $grid = array('uri' => 'cp/content/banners/groups/browse', 'keyword' => 'bannersgroups', 'header' => array('name' => array('html' => __('name', 'system'), 'class' => 'name'), 'actions' => array('html' => __('actions', 'system'), 'class' => 'actions')), 'content' => array());
     // Create grid content
     foreach ($groups as $group) {
         $grid['content'][] = array('name' => array('html' => html_helper::anchor('cp/content/banners/groups/edit/' . $group['group_id'], text_helper::truncate(text_helper::entities($group['name']), 64))), 'actions' => array('html' => array('banners' => html_helper::anchor('cp/content/banners/browse/' . $group['group_id'], __('banners', 'banners'), array('class' => 'banners')), 'edit' => html_helper::anchor('cp/content/banners/groups/edit/' . $group['group_id'], __('edit', 'system'), array('class' => 'edit')), 'delete' => html_helper::anchor('cp/content/banners/groups/delete/' . $group['group_id'], __('delete', 'system'), array('data-html' => __('group_delete?', 'banners'), 'data-role' => 'confirm', 'class' => 'delete')))));
     }
     // Filter hooks
     hook::filter('cp/content/banners/groups/browse/grid', $grid);
     // Assign vars
     view::assign(array('grid' => $grid));
     // Set title
     view::setTitle(__('banners_groups_manage', 'system_navigation'));
     // Set title
     view::setAction('cp/content/banners/groups/edit', __('group_new', 'banners'), array('class' => 'icon-text icon-banners-groups-new'));
     // Load view
     view::load('cp/content/banners/groups/browse');
 }
开发者ID:soremi,项目名称:tutornavi,代码行数:23,代码来源:groups.php

示例10: browse

 public function browse()
 {
     // Get templates
     if (!($templates = $this->messages_templates_model->getTemplates())) {
         view::setInfo(__('no_templates', 'messages_templates'));
     }
     // Create table grid
     $grid = array('uri' => 'cp/plugins/messages/templates/browse', 'keyword' => 'messages_templates', 'header' => array('name' => array('html' => __('name', 'system'), 'class' => 'name'), 'status' => array('html' => __('active', 'system'), 'class' => 'status'), 'actions' => array('html' => __('actions', 'system'), 'class' => 'actions')), 'content' => array());
     // Create grid content
     foreach ($templates as $template) {
         $grid['content'][] = array('name' => array('html' => html_helper::anchor('cp/plugins/messages/templates/edit/' . $template['template_id'], text_helper::truncate($template['name'], 64))), 'status' => array('html' => $template['active'] ? '<span class="label success small">' . __('yes', 'system') . '</span>' : '<span class="label important small">' . __('no', 'system') . '</span>'), 'actions' => array('html' => array('edit' => html_helper::anchor('cp/plugins/messages/templates/edit/' . $template['template_id'], __('edit', 'system'), array('class' => 'edit')), 'delete' => html_helper::anchor('cp/plugins/messages/templates/delete/' . $template['template_id'], __('delete', 'system'), array('data-html' => __('template_delete?', 'messages_templates'), 'data-role' => 'confirm', 'class' => 'delete')))));
     }
     // Filter hooks
     hook::filter('cp/plugins/messages/templates/browse/grid', $grid);
     // Assign vars
     view::assign(array('grid' => $grid));
     // Set title
     view::setTitle(__('messages_templates_manage', 'system_navigation'));
     // Set action
     view::setAction('cp/plugins/messages/templates/edit', __('template_new', 'messages_templates'), array('class' => 'icon-text icon-messages-templates-new'));
     // Load view
     view::load('cp/plugins/messages/templates/browse');
 }
开发者ID:soremi,项目名称:tutornavi,代码行数:23,代码来源:templates.php

示例11: browse

 public function browse()
 {
     // Get newsletters
     if (!($newsletters = $this->newsletters_model->getNewsletters())) {
         view::setInfo(__('no_newsletters', 'newsletters'));
     }
     // Create table grid
     $grid = array('uri' => 'cp/content/newsletters/browse', 'keyword' => 'newsletters', 'header' => array('name' => array('html' => __('newsletter_subject', 'newsletters'), 'class' => 'name'), 'status' => array('html' => __('status', 'system'), 'class' => 'status'), 'actions' => array('html' => __('actions', 'system'), 'class' => 'actions')), 'content' => array());
     // Create grid content
     foreach ($newsletters as $newsletter) {
         $grid['content'][] = array('name' => array('html' => html_helper::anchor('cp/content/newsletters/edit/' . $newsletter['newsletter_id'], text_helper::truncate($newsletter['subject'], 64))), 'status' => array('html' => $newsletter['total_sent'] ? '<span class="label small info">' . __('pending', 'system') . '</span>' : '<span class="label small success">' . __('active', 'system') . '</span>'), 'actions' => array('html' => array('send' => html_helper::anchor('cp/content/newsletters/review/' . $newsletter['newsletter_id'], __('newsletter_review', 'newsletters'), array('class' => 'review')), 'edit' => html_helper::anchor('cp/content/newsletters/edit/' . $newsletter['newsletter_id'], __('edit', 'system'), array('class' => 'edit')), 'delete' => html_helper::anchor('cp/content/newsletters/delete/' . $newsletter['newsletter_id'], __('delete', 'system'), array('data-html' => __('newsletter_delete?', 'newsletters'), 'data-role' => 'confirm', 'class' => 'delete')))));
     }
     // Filter hooks
     hook::filter('cp/content/newsletters/browse/grid', $grid);
     // Assign vars
     view::assign(array('grid' => $grid));
     // Set title
     view::setTitle(__('newsletters_manage', 'system_navigation'));
     // Set action
     view::setAction('cp/content/newsletters/edit', __('newsletter_new', 'newsletters'), array('class' => 'icon-text icon-newsletters-new'));
     // Load view
     view::load('cp/content/newsletters/browse');
 }
开发者ID:soremi,项目名称:tutornavi,代码行数:23,代码来源:newsletters.php

示例12: __

<div class="item-article">

	<div class="action-header">
		<?php 
echo __('blog_post', 'timeline', array('[name]' => users_helper::anchor($user)));
?>
	</div>

	<div class="target-article article">
		<div class="target-header">
			<?php 
echo html_helper::anchor('blogs/view/' . $blog['blog_id'] . '/' . text_helper::slug($blog['data_title'], 100), $blog['data_title']);
?>
		</div>
		<?php 
echo text_helper::truncate($blog['data_body'], 310);
?>
	</div>

</div>
开发者ID:soremi,项目名称:tutornavi,代码行数:20,代码来源:blog.php

示例13: urlencode

                ?>
										<?php 
                echo html_helper::anchor('http://maps.google.com/?q=' . urlencode(implode(',', $ad['data_location'])), implode(', ', $ad['data_location']), array('target' => '_blank'));
                ?>
									<?php 
            }
            ?>
								</dd>
							<?php 
        }
        ?>
						</dl>

						<div class="item-article">
							<?php 
        echo text_helper::truncate($ad['data_body'], config::item('ad_preview_chars', 'classifieds'));
        ?>
						</div>

						<footer class="item-footer">

							<ul class="unstyled content-meta clearfix">
								<li class="date">
									<?php 
        echo __('author_date', 'system_info', array('%author' => users_helper::anchor($ad['user']), '%date' => date_helper::formatDate($ad['post_date'])));
        ?>
								</li>
								<?php 
        if (config::item('ad_views', 'classifieds')) {
            ?>
									<li class="views">
开发者ID:soremi,项目名称:tutornavi,代码行数:31,代码来源:index.php

示例14: array_merge

							<?php 
        view::load('users/profile/elements/picture', array_merge($blog['user'], array('picture_file_suffix' => 't')));
        ?>
						</figure>

						<header class="item-header">
							<h2>
								<?php 
        echo html_helper::anchor('blogs/view/' . $blog['blog_id'] . '/' . text_helper::slug($blog['data_title'], 100), $blog['data_title']);
        ?>
							</h2>
						</header>

						<div class="item-article">
							<?php 
        echo text_helper::truncate($blog['data_body'], config::item('blogs_preview_chars', 'blogs'));
        ?>
						</div>

						<footer class="item-footer">

							<ul class="unstyled content-meta clearfix">
								<li class="date">
									<?php 
        echo __('author_date', 'system_info', array('%author' => users_helper::anchor($blog['user']), '%date' => date_helper::formatDate($blog['post_date'])));
        ?>
								</li>
								<?php 
        if (config::item('blog_views', 'blogs')) {
            ?>
									<li class="views">
开发者ID:soremi,项目名称:tutornavi,代码行数:31,代码来源:index.php

示例15: isset

									<?php 
            if ($item['uri'] !== false) {
                ?>
										<?php 
                if ($index && (!isset($item['attr']['side']) || !$item['attr']['side'])) {
                    ?>
											<li>&#187;</li>
										<?php 
                }
                ?>
										<li <?php 
                echo isset($item['attr']['side']) && $item['attr']['side'] ? 'class="side"' : '';
                ?>
><?php 
                echo html_helper::anchor($item['uri'], text_helper::truncate($item['name'], 40));
                ?>
</li>
									<?php 
            } else {
                ?>
										<li <?php 
                echo isset($item['attr']['side']) && $item['attr']['side'] ? 'class="side"' : '';
                ?>
><?php 
                echo $item['name'];
                ?>
</li>
									<?php 
            }
            ?>
开发者ID:soremi,项目名称:tutornavi,代码行数:30,代码来源:header.php


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