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


PHP text_helper类代码示例

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


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

示例1: settings

 public function settings()
 {
     // Get URI vars
     $keyword = uri::segment(5);
     // Get service
     if (!$keyword || !($service = $this->users_authentication_model->getService($keyword))) {
         view::setError(__('no_service', 'users_authentication'));
         router::redirect('cp/users/authentication');
     }
     // Get manifest
     $manifest = $this->users_authentication_model->getManifest($keyword);
     // Is demo mode enabled?
     if (input::demo(0)) {
         foreach ($service['settings'] as $k => $v) {
             if ($v) {
                 $service['settings'][$k] = 'hidden in this demo';
             }
         }
     }
     // Assign vars
     view::assign(array('manifest' => $manifest, 'service' => $service));
     // Process form values
     if (input::post('do_save_settings')) {
         $this->_saveSettings($keyword, $manifest, $service);
     }
     // Set title
     view::setTitle(__('settings', 'system'));
     // Set trail
     view::setTrail('cp/users/authentication/settings/' . $keyword, __('settings', 'system') . ' - ' . text_helper::entities($service['name']));
     // Load view
     view::load('cp/users/authentication/settings');
 }
开发者ID:soremi,项目名称:tutornavi,代码行数:32,代码来源:authentication.php

示例2: edit

 public function edit()
 {
     // Get URI vars
     $templateID = (int) uri::segment(6);
     // Get template
     $template = array();
     if ($templateID && !($template = $this->messages_templates_model->getTemplate($templateID, false))) {
         view::setError(__('no_template', 'messages_templates'));
         router::redirect('cp/plugins/messages/templates');
     }
     // Assign vars
     view::assign(array('templateID' => $templateID, 'template' => $template));
     // Process form values
     if (input::post('do_save_template')) {
         $this->_saveTemplate($templateID);
     }
     // Set title
     view::setTitle($templateID ? __('template_edit', 'messages_templates') : __('template_new', 'messages_templates'));
     // Set trail
     view::setTrail('cp/plugins/messages/templates/edit/' . ($templateID ? $templateID : ''), $templateID ? __('template_edit', 'messages_templates') . ' - ' . text_helper::entities($template['name']) : __('template_new', 'messages_templates'));
     // Set actions
     if (count(config::item('languages', 'core', 'keywords')) > 1) {
         view::setAction('translate', '');
     }
     // Load view
     view::load('cp/plugins/messages/templates/edit');
 }
开发者ID:soremi,项目名称:tutornavi,代码行数:27,代码来源:templates.php

示例3: edit

 public function edit()
 {
     // Get URI vars
     $subjectID = (int) uri::segment(6);
     // Get subject
     $subject = array();
     if ($subjectID && !($subject = $this->reports_subjects_model->getSubject($subjectID, false))) {
         view::setError(__('no_subject', 'reports_subjects'));
         router::redirect('cp/content/reports/subjects');
     }
     // Assign vars
     view::assign(array('subjectID' => $subjectID, 'subject' => $subject));
     // Process form values
     if (input::post('do_save_subject')) {
         $this->_saveSubject($subjectID);
     }
     // Set title
     view::setTitle($subjectID ? __('subject_edit', 'reports_subjects') : __('subject_new', 'reports_subjects'));
     // Set trail
     view::setTrail('cp/content/reports/subjects/edit/' . ($subjectID ? $subjectID : ''), $subjectID ? __('subject_edit', 'reports_subjects') . ' - ' . text_helper::entities($subject['name']) : __('subject_new', 'reports_subjects'));
     // Set actions
     if (count(config::item('languages', 'core', 'keywords')) > 1) {
         view::setAction('translate', '');
     }
     // Load view
     view::load('cp/content/reports/subjects/edit');
 }
开发者ID:soremi,项目名称:tutornavi,代码行数:27,代码来源:subjects.php

示例4: edit

 public function edit()
 {
     // Get URI vars
     $groupID = (int) uri::segment(6);
     // Get group
     $group = array();
     if ($groupID && !($group = $this->banners_groups_model->getGroup($groupID))) {
         view::setError(__('no_group', 'banners'));
         router::redirect('cp/content/banners/groups');
     }
     // Assign vars
     view::assign(array('groupID' => $groupID, 'group' => $group));
     // Process form values
     if (input::post('do_save_group')) {
         $this->_saveGroup($groupID);
     }
     // Set title
     view::setTitle($groupID ? __('group_edit', 'banners') : __('group_new', 'banners'));
     // Set trail
     view::setTrail('cp/content/banners/groups/edit/' . ($groupID ? $groupID : ''), $groupID ? __('group_edit', 'banners') . ' - ' . text_helper::entities($group['name']) : __('group_new', 'banners'));
     // Assign actions
     if ($groupID) {
         view::setAction('cp/content/banners/browse/' . $groupID, __('banners', 'banners'), array('class' => 'icon-text icon-banners'));
     }
     // Load view
     view::load('cp/content/banners/groups/edit');
 }
开发者ID:soremi,项目名称:tutornavi,代码行数:27,代码来源:groups.php

示例5: usersViewActionsAlbums

 public function usersViewActionsAlbums($user)
 {
     if (!$user['total_albums']) {
         return '';
     }
     echo '<li class="pictures-albums">' . html_helper::anchor('pictures/user/' . text_helper::entities($user['username']), __('pictures_albums', 'system_navigation') . ' (' . $user['total_albums'] . ')') . '</li>';
 }
开发者ID:soremi,项目名称:tutornavi,代码行数:7,代码来源:pictures.php

示例6: account

 public function account()
 {
     // Create account settings
     $settings = array();
     $settings['email'] = array('name' => __('email', 'users'), 'keyword' => 'email', 'type' => 'static', 'value' => text_helper::entities(session::item('email')) . ' - ' . html_helper::anchor('users/settings/email', __('email_change', 'users')) . (config::item('auth_methods', 'users', 'default') ? ' - ' . html_helper::anchor('users/settings/password', __('password_change', 'users')) : '') . (session::permission('users_account_cancel', 'users') ? ' - ' . html_helper::anchor('users/settings/cancel', __('account_cancel', 'users')) : ''));
     if (config::item('user_username', 'users')) {
         $settings['username'] = array('name' => __('username', 'users'), 'keyword' => 'username', 'type' => 'static', 'value' => text_helper::entities(session::item('username')) . (config::item('user_username_modify', 'users') ? ' - ' . html_helper::anchor('users/settings/username', __('username_change', 'users')) : ''));
     }
     if (!config::item('time_zone_override', 'system')) {
         $settings['time_zone'] = array('name' => __('time_zone', 'users_account'), 'keyword' => 'time_zone', 'type' => 'select', 'items' => date_helper::timezones(), 'value' => session::item('time_zone'), 'rules' => array('callback__is_valid_time_zone'));
     }
     if (!config::item('language_override', 'system') && session::permission('change_languages', 'system')) {
         $settings['language_id'] = array('name' => __('language', 'users_account'), 'keyword' => 'language_id', 'type' => 'select', 'items' => config::item('languages', 'core', 'names'), 'value' => session::item('language_id'), 'rules' => array('callback__is_valid_language_id'));
     }
     if (!config::item('template_override', 'system') && session::permission('change_templates', 'system')) {
         $settings['template_id'] = array('name' => __('template', 'users_account'), 'keyword' => 'template_id', 'type' => 'select', 'items' => config::item('templates', 'core', 'names'), 'value' => session::item('template_id'), 'rules' => array('callback__is_valid_template_id'));
     }
     // Filter hook
     $settings = hook::filter('users/settings/account/options', $settings);
     // Assign vars
     view::assign(array('settings' => $settings));
     // Process form values
     if (input::post('do_save_settings')) {
         $this->_saveSettings($settings);
     }
     // Set title
     view::setTitle(__('settings', 'users'));
     // Load view
     view::load('users/settings/account');
 }
开发者ID:soremi,项目名称:tutornavi,代码行数:30,代码来源:settings.php

示例7: edit

 public function edit()
 {
     // Get URI vars
     $templateID = (int) uri::segment(6);
     // Get template
     $template = array();
     if ($templateID && !($template = $this->newsletters_templates_model->getTemplate($templateID, false))) {
         view::setError(__('no_template', 'newsletters_templates'));
         router::redirect('cp/content/newsletters/templates');
     }
     // Assign vars
     view::assign(array('templateID' => $templateID, 'template' => $template));
     // Process form values
     if (input::post('do_save_template')) {
         $this->_saveTemplate($templateID);
     }
     // Set title
     view::setTitle($templateID ? __('template_edit', 'newsletters_templates') : __('template_new', 'newsletters_templates'));
     // Set trail
     view::setTrail('cp/content/newsletters/templates/edit/' . ($templateID ? $templateID : ''), $templateID ? __('template_edit', 'newsletters_templates') . ' - ' . text_helper::entities($template['name']) : __('template_new', 'newsletters_templates'));
     // Load ckeditor
     view::includeJavascript('externals/ckeditor/ckeditor.js');
     // Load view
     view::load('cp/content/newsletters/templates/edit');
 }
开发者ID:soremi,项目名称:tutornavi,代码行数:25,代码来源:templates.php

示例8: usersViewActionsAds

 public function usersViewActionsAds($user)
 {
     if (!$user['total_classifieds']) {
         return '';
     }
     echo '<li class="classifieds">' . html_helper::anchor('classifieds/user/' . text_helper::entities($user['username']), __('classifieds', 'system_navigation') . ' (' . $user['total_classifieds'] . ')') . '</li>';
 }
开发者ID:soremi,项目名称:tutornavi,代码行数:7,代码来源:classifieds.php

示例9: getTypes

 public function getTypes($escape = true)
 {
     // Get user types
     $types = $this->db->query("SELECT * FROM `:prefix:users_types` ORDER BY order_id ASC")->result();
     foreach ($types as $index => $type) {
         $types[$index]['name'] = $escape ? text_helper::entities($type['name_' . session::item('language')]) : $type['name_' . session::item('language')];
     }
     return $types;
 }
开发者ID:soremi,项目名称:tutornavi,代码行数:9,代码来源:types.php

示例10: saveSearch

 public function saveSearch($conditions = array(), $values = array(), $results = 0)
 {
     $data = array('search_id' => text_helper::random(8), 'user_id' => session::item('user_id'), 'conditions' => json_encode($conditions), 'values' => json_encode($values), 'results' => $results, 'post_date' => date_helper::now());
     if (!session::item('user_id')) {
         $data['ip_address'] = input::ipaddress();
     }
     $this->db->insert('core_search', $data);
     return $data['search_id'];
 }
开发者ID:soremi,项目名称:tutornavi,代码行数:9,代码来源:search.php

示例11: getPlans

 public function getPlans($active = true, $escape = true)
 {
     // Get plans
     $plans = $this->db->query("SELECT * FROM `:prefix:billing_plans` " . ($active ? "WHERE `active`=1" : "") . " ORDER BY `order_id` ASC")->result();
     foreach ($plans as $index => $plan) {
         $plans[$index]['name'] = $escape ? text_helper::entities($plan['name_' . session::item('language')]) : $plan['name_' . session::item('language')];
         $plans[$index]['description'] = $escape ? text_helper::entities($plan['description_' . session::item('language')]) : $plan['description_' . session::item('language')];
     }
     return $plans;
 }
开发者ID:soremi,项目名称:tutornavi,代码行数:10,代码来源:plans.php

示例12: getPlugins

 public function getPlugins($escape = true)
 {
     $plugins = array();
     $result = $this->db->query("SELECT `plugin` FROM `:prefix:core_meta_tags` GROUP BY `plugin`")->result();
     foreach ($result as $plugin) {
         $plugins[$plugin['plugin']] = $escape ? text_helper::entities(config::item('plugins', 'core', $plugin['plugin'], 'name')) : config::item('plugins', 'core', $plugin['plugin'], 'name');
     }
     asort($plugins);
     return $plugins;
 }
开发者ID:soremi,项目名称:tutornavi,代码行数:10,代码来源:metatags.php

示例13: name

 public static function name($name1, $name2, $escape = false)
 {
     if ($name1 == '') {
         $name1 = __('user', 'users');
         $name2 = '';
     } elseif ($escape) {
         $name1 = text_helper::entities($name1);
         $name2 = text_helper::entities($name2);
     }
     $name = $name2 != '' ? $name1 . ' ' . $name2 : $name1;
     return $name;
 }
开发者ID:soremi,项目名称:tutornavi,代码行数:12,代码来源:users.php

示例14: getPlugins

 public function getPlugins($escape = true)
 {
     $plugins = array();
     foreach (config::item('plugins', 'core') as $plugin) {
         if (file_exists(DOCPATH . 'models/' . $plugin['keyword'] . '/' . $plugin['keyword'] . EXT)) {
             $model = loader::model($plugin['keyword'] . '/' . $plugin['keyword'], array(), null);
             if (method_exists($model, 'updateDbCounters')) {
                 $plugins[$plugin['keyword']] = $escape ? text_helper::entities($plugin['name']) : $plugin['name'];
             }
         }
     }
     asort($plugins);
     return $plugins;
 }
开发者ID:soremi,项目名称:tutornavi,代码行数:14,代码来源:counters.php

示例15: getNewsletters

 public function getNewsletters($escape = true)
 {
     // Get newsletters
     $newsletters = $this->db->query("SELECT * FROM `:prefix:newsletters` ORDER BY `subject` ASC")->result();
     foreach ($newsletters as $index => $newsletter) {
         if ($escape) {
             $newsletter['subject'] = text_helper::entities($newsletter['subject']);
             $newsletter['message_html'] = text_helper::entities($newsletter['message_html']);
             $newsletter['message_text'] = text_helper::entities($newsletter['message_text']);
         }
         $newsletters[$index] = $newsletter;
     }
     return $newsletters;
 }
开发者ID:soremi,项目名称:tutornavi,代码行数:14,代码来源:newsletters.php


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