本文整理汇总了PHP中text_helper::entities方法的典型用法代码示例。如果您正苦于以下问题:PHP text_helper::entities方法的具体用法?PHP text_helper::entities怎么用?PHP text_helper::entities使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类text_helper
的用法示例。
在下文中一共展示了text_helper::entities方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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');
}
示例2: 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');
}
示例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');
}
示例4: 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');
}
示例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>';
}
示例6: 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');
}
示例7: 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>';
}
示例8: 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');
}
示例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;
}
示例10: 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;
}
示例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;
}
示例12: 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;
}
示例13: 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;
}
示例14: 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;
}
示例15: 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');
}