本文整理汇总了PHP中text_helper类的典型用法代码示例。如果您正苦于以下问题:PHP text_helper类的具体用法?PHP text_helper怎么用?PHP text_helper使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了text_helper类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: 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
示例17: getTemplates
public function getTemplates($escape = true)
{
// Get templates
$templates = $this->db->query("SELECT * FROM `:prefix:newsletters_templates` ORDER BY `name` ASC")->result();
if ($escape) {
foreach ($templates as $index => $template) {
$template['name'] = text_helper::entities($template['name']);
$template['subject'] = text_helper::entities($template['subject']);
$template['message_html'] = text_helper::entities($template['message_html']);
$template['message_text'] = text_helper::entities($template['message_text']);
$templates[$index] = $template;
}
}
return $templates;
}
开发者ID:soremi,项目名称:tutornavi,代码行数:15,代码来源:templates.php
示例18: getSubjects
public function getSubjects($escape = true, $active = false)
{
// Get subjects
$subjects = $this->db->query("SELECT * FROM `:prefix:reports_subjects` " . ($active ? "WHERE `active`=1" : "") . " ORDER BY `order_id` ASC")->result();
foreach ($subjects as $index => $subject) {
if ($escape) {
foreach (config::item('languages', 'core', 'keywords') as $language) {
$subject['name_' . $language] = text_helper::entities($subject['name_' . $language]);
}
}
$subject['name'] = $subject['name_' . session::item('language')];
$subjects[$index] = $subject;
}
return $subjects;
}
开发者ID:soremi,项目名称:tutornavi,代码行数:15,代码来源:subjects.php
示例19: edit
public function edit()
{
// Get URI vars
$typeID = (int) uri::segment(5);
// Get type
$type = array();
if ($typeID && !($type = $this->users_types_model->getType($typeID, false))) {
view::setError(__('no_type', 'users_types'));
router::redirect('cp/users/types');
}
$fields = array();
// Do we have an existing type?
if ($typeID) {
// Get text fields
$fields = array('' => __('none', 'system'));
foreach ($this->fields_model->getFields('users', $typeID) as $field) {
if ($field['type'] == 'text') {
$fields[$field['keyword']] = $field['name'];
}
}
}
// Assign vars
view::assign(array('typeID' => $typeID, 'type' => $type, 'fields' => $fields));
// Process form values
if (input::post('do_save_type')) {
$this->_saveType($typeID, $type, $fields);
}
// Set title
view::setTitle($typeID ? __('type_edit', 'users_types') : __('type_new', 'users_types'));
// Set trail
view::setTrail('cp/users/types/edit/' . ($typeID ? $typeID : ''), $typeID ? __('type_edit', 'users_types') . ' - ' . text_helper::entities($type['name']) : __('type_new', 'users_types'));
// Set trail
if ($typeID) {
// Assign actions
view::setAction('cp/system/fields/users/browse/' . $typeID, __('profile_questions', 'users_types'), array('class' => 'icon-text icon-system-fields'));
}
if (count(config::item('languages', 'core', 'keywords')) > 1) {
view::setAction('translate', '');
}
// Load view
view::load('cp/users/types/edit');
}
开发者ID:soremi,项目名称:tutornavi,代码行数:42,代码来源:types.php
示例20: getManifest
public function getManifest($keyword, $existing = false, $escape = true)
{
$manifest = array();
// Include manifest file
if (@is_file(DOCPATH . 'plugins/' . $keyword . '/manifest.php') && @(include DOCPATH . 'plugins/' . $keyword . '/manifest.php')) {
// Does params variable exist?
if (isset($params) && isset($params['name'])) {
$manifest = array('keyword' => $keyword, 'name' => $params['name'], 'values' => array(), 'description' => isset($params['description']) ? $params['description'] : '', 'author' => isset($params['author']) ? $params['author'] : '', 'website' => isset($params['website']) ? $params['website'] : '', 'version' => isset($params['version']) ? $params['version'] : '1.0', 'requirements' => isset($params['requirements']) && is_array($params['requirements']) ? $params['requirements'] : array(), 'settings' => isset($params['settings']) && $params['settings'] ? 1 : 0);
if ($escape) {
foreach (array('name', 'description', 'author', 'version') as $item) {
$manifest[$item] = text_helper::entities($manifest[$item]);
}
}
}
}
if ($existing) {
$plugin = $this->db->query("SELECT * FROM `:prefix:core_plugins` WHERE `keyword`=? LIMIT 1", array($keyword))->row();
if ($plugin) {
$manifest['version_current'] = $escape ? text_helper::entities($plugin['version']) : $plugin['version'];
}
}
return $manifest;
}
开发者ID:soremi,项目名称:tutornavi,代码行数:23,代码来源:plugins.php
注:本文中的text_helper类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论