本文整理汇总了PHP中view::setTrail方法的典型用法代码示例。如果您正苦于以下问题:PHP view::setTrail方法的具体用法?PHP view::setTrail怎么用?PHP view::setTrail使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类view
的用法示例。
在下文中一共展示了view::setTrail方法的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');
}
示例2: 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');
}
示例3: edit
public function edit()
{
// Get URI vars
$fieldID = (int) uri::segment(7);
// Set title
view::setTitle($fieldID ? __('edit_field', 'system_fields') : __('new_field', 'system_fields'));
// Set trail
view::setTrail('cp/system/fields/blogs/browse', __('fields', 'system_fields'));
// Hide options array
$hidden = array('html' => 0, 'in_search_advanced' => 0);
if ($fieldID) {
$field = $this->fields_model->getField($fieldID);
if ($field) {
switch ($field['keyword']) {
case 'title':
$hidden['required'] = 1;
$hidden['in_search'] = 0;
$hidden['system'] = 1;
break;
case 'body':
$hidden['required'] = 1;
$hidden['in_search'] = 0;
$hidden['system'] = 1;
break;
}
}
}
// Additional field configuration array
$config = array(array('label' => __('config_in_view', 'system_fields'), 'keyword' => 'in_view', 'type' => 'boolean', 'rules' => array('intval')), array('label' => __('config_in_account', 'system_fields'), 'keyword' => 'in_account', 'type' => 'boolean', 'rules' => array('intval')), array('label' => __('config_in_list', 'system_fields'), 'keyword' => 'in_list', 'type' => 'boolean', 'rules' => array('intval')));
// Edit custom field
$this->editField('blogs', 'blogs_data', 0, $fieldID, $config, $hidden);
}
示例4: 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');
}
示例5: payment
public function payment()
{
// Get URI vars
$planID = (int) uri::segment(4);
// Get plan
if (!$planID || !($plan = $this->plans_model->getPlan($planID)) || !$plan['active']) {
view::setError(__('no_plan', 'billing_plans'));
router::redirect('billing/plans');
}
// Get gateways
if (!($gateways = $this->gateways_model->getGateways())) {
view::setError(__('no_gateways_user', 'billing_gateways'));
router::redirect('billing/plans');
}
// Product
$plan['product_id'] = $planID;
$plan['type'] = 'plans';
// Assign vars
view::assign(array('product' => $plan, 'gateways' => $gateways, 'location' => 'billing/plans/payment/' . $planID));
// Set title
view::setTitle(__('payment', 'billing_transactions'));
// Set trail
view::setTrail('billing/plans', __('plans', 'billing_plans'));
// Load view
view::load('billing/payment');
}
示例6: __construct
public function __construct($tabs = true, $loggedin = true)
{
parent::__construct();
// Is user loggedin ?
if ($loggedin && !users_helper::isLoggedin()) {
router::redirect('users/login');
}
// Set trail
view::setTrail(session::item('slug'), __('my_profile', 'system_navigation'));
view::setTrail('users/settings', __('settings', 'users'));
// Set tabs
if ($tabs) {
view::setTab('users/settings', __('settings', 'users'), array('class' => (uri::segment(1) == 'users' && uri::segment(2) == 'settings' && (!uri::segment(3) || in_array(uri::segment(3), array('email', 'password', 'username', 'cancel'))) || uri::segment(1) == 'billing' && uri::segment(2) != 'invoices' ? 'active' : '') . ' icon-users-settings'));
if (config::item('privacy_edit', 'users')) {
view::setTab('users/settings/privacy', __('privacy', 'users'), array('class' => (uri::segment(1) == 'users' && uri::segment(3) == 'privacy' ? 'active' : '') . ' icon-users-privacy'));
}
if (config::item('notifications_edit', 'users')) {
view::setTab('users/settings/notifications', __('notifications', 'users'), array('class' => (uri::segment(1) == 'users' && uri::segment(3) == 'notifications' ? 'active' : '') . ' icon-users-notifications'));
}
if (config::item('blacklist_active', 'users')) {
view::setTab('users/blocked', __('blacklist', 'users'), array('class' => (uri::segment(1) == 'users' && uri::segment(2) == 'blocked' ? 'active' : '') . ' icon-users-blacklist'));
}
}
// Filter hook
hook::action('users/settings/tabs');
}
示例7: 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');
}
示例8: 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');
}
示例9: payment
public function payment()
{
// Get URI vars
$packageID = (int) uri::segment(4);
// Get package
if (!$packageID || !($package = $this->credits_model->getPackage($packageID)) || !$package['active']) {
view::setError(__('no_package', 'billing_credits'));
router::redirect('billing/credits');
}
// Get gateways
if (!($gateways = $this->gateways_model->getGateways())) {
view::setError(__('no_gateways_user', 'billing_gateways'));
router::redirect('billing/credits');
}
// Product
$package['product_id'] = $packageID;
$package['name'] = __('credits_info', 'billing_credits', array('%s' => $package['credits']));
$package['type'] = 'credits';
// Assign vars
view::assign(array('product' => $package, 'gateways' => $gateways, 'location' => 'billing/credits/payment/' . $packageID));
// Set title
view::setTitle(__('payment', 'billing_transactions'));
// Set trail
view::setTrail('billing/credits', __('credits', 'billing_credits'));
// Load view
view::load('billing/payment');
}
示例10: __construct
public function __construct()
{
parent::__construct();
// Does user have permission to access this plugin?
if (!session::permission('settings_manage', 'users')) {
view::noAccess();
}
view::setCustomParam('section', 'users');
view::setCustomParam('options', config::item('cp_top_nav', 'lists', 'users', 'items'));
view::setTrail('cp/users', __('users', 'system_navigation'));
}
示例11: __construct
public function __construct()
{
parent::__construct();
// Does user have permission to access this plugin?
if (!session::permission('counters_manage', 'utilities')) {
view::noAccess();
}
view::setCustomParam('section', 'system');
view::setCustomParam('options', config::item('cp_top_nav', 'lists', 'system', 'items', 'system/utilities', 'items'));
loader::model('utilities/counters', array(), 'recalculate_model');
view::setTrail('cp/system/config/system', __('system', 'system_navigation'));
view::setTrail('cp/utilities/counters', __('utilities_counters', 'system_navigation'));
}
示例12: __construct
public function __construct()
{
parent::__construct();
if (!config::item('messages_active', 'messages')) {
error::show404();
} elseif (!users_helper::isLoggedin()) {
router::redirect('users/login');
} elseif (!session::permission('messages_access', 'messages')) {
view::noAccess();
}
// Set trail
view::setTrail(session::item('slug'), __('my_profile', 'system_navigation'));
view::setTrail('messages/manage', __('messages', 'system_navigation'));
loader::model('messages/messages');
}
示例13: __construct
public function __construct()
{
parent::__construct();
// Does user have permission to access this plugin?
if (!session::permission('license_manage', 'system')) {
view::noAccess();
}
view::setCustomParam('section', 'help');
view::setCustomParam('options', array('help/license' => array('name' => __('help_license', 'system_navigation'), 'uri' => 'help/license', 'keyword' => 'help/license', 'attr' => array('help license'), 'items' => array())));
loader::model('system/license');
view::setTrail('cp/help/license', __('help', 'system_navigation'));
view::setTrail('cp/help/license', __('help_license', 'system_navigation'));
// Check if demo mode is enabled
if (input::demo(1, 'cp/system/config/system')) {
return false;
}
}
示例14: browse
public function browse()
{
// Parameters
$params = array('join_columns' => array("`u`.`picture_id`!=0"), 'join_items' => array());
// Process filters
$params = $this->parseCounters($params, 0);
// 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 albums
if (input::post('action') && isset($actions[input::post('action')]) && input::post('user_id') && is_array(input::post('user_id'))) {
foreach (input::post('user_id') as $userID) {
$userID = (int) $userID;
if ($userID && $userID > 0) {
$this->action(input::post('action'), $userID);
}
}
}
// Success
view::setInfo(__('action_applied', 'system'));
router::redirect('cp/users/pictures/browse?' . $qstring['url'] . 'page=' . $qstring['page']);
}
// Get pictures
$users = array();
if ($params['total']) {
$users = $this->users_model->getUsers('in_list', isset($params['values']['type']) ? $params['values']['type'] : 0, $params['join_columns'], $params['join_items'], $qstring['order'], $qstring['limit']);
}
// Set pagination
$config = array('base_url' => config::siteURL('cp/users/pictures/browse?' . $qstring['url']), 'total_items' => $params['total'], 'items_per_page' => $this->picturesPerPage, 'current_page' => $qstring['page'], 'uri_segment' => 'page');
$pagination = loader::library('pagination', $config, null);
// Assign vars
view::assign(array('users' => $users, 'pagination' => $pagination, 'actions' => $actions));
// Set title
view::setTitle(__('users_pictures_manage', 'system_navigation'));
// Set trail
if ($qstring['search_id']) {
view::setTrail('cp/users/pictures/browse?' . $qstring['url'] . 'page=' . $qstring['page'], __('search_results', 'system'));
}
// Assign actions
view::setAction('#', __('search', 'system'), array('class' => 'icon-text icon-system-search', 'onclick' => '$(\'#pictures-search\').toggle();return false;'));
// Load view
view::load('cp/users/pictures/browse');
}
示例15: view
public function view()
{
// Get URI vars
$listID = uri::segment(6);
// Get list
if (!$listID || !($list = $this->lists_model->getList($listID))) {
router::redirect('cp/system/config/system');
}
// Did we submit the form?
if (input::post('action') == 'reorder' && input::post('ids')) {
$this->_reorderItems();
}
// Get items
if (!($items = $this->lists_model->getItems($listID))) {
router::redirect('cp/system/config/system');
}
// Create table grid
$grid = array('uri' => 'cp/system/templates/navigation', 'keyword' => 'templates', 'header' => array('name' => array('html' => __('name', 'system'), 'class' => 'name'), 'active' => array('html' => __('active', 'system'), 'class' => 'status')), 'content' => array());
// Create grid content
foreach ($items as $item) {
$grid['content'][] = array('name' => array('html' => $item['name']), 'status' => array('html' => html_helper::anchor('cp/system/templates/navigation/togglestatus/' . $item['item_id'], $item['active'] ? __('yes', 'system') : __('no', 'system'), array('class' => $item['active'] ? 'label success small' : 'label important small'))));
}
// Filter hooks
hook::filter('cp/system/templates/navigation/browse/grid', $grid);
// Assign vars
view::assign(array('grid' => $grid, 'items' => $items, 'listID' => $listID));
// Set title
view::setTitle(__('system_templates_navigation_manage', 'system_navigation'));
// Set trail
view::setTrail('cp/system/templates/navigation/view/' . $listID, $list['name']);
// Set actions
view::setAction('#', __('done', 'system'), array('class' => 'icon-text icon-system-done', 'onclick' => 'saveSortable();return false;', 'id' => 'actions_link_save'));
view::setAction('#', __('cancel', 'system'), array('class' => 'icon-text icon-system-cancel', 'onclick' => 'cancelSortable();return false;', 'id' => 'actions_link_cancel'));
view::setAction('#', __('reorder', 'system'), array('class' => 'icon-text icon-system-sort', 'onclick' => 'switchSortable();return false;', 'id' => 'actions_link_reorder'));
// Include sortable vendor files
view::includeJavascript('externals/html5sortable/html5sortable.js');
view::includeStylesheet('externals/html5sortable/style.css');
// Load view
if (input::isAjaxRequest()) {
view::load('cp/system/templates/navigation/items/browse_' . (input::post('view') == 'list' ? 'list' : 'grid'));
} else {
view::load('cp/system/templates/navigation/items/browse');
}
}