本文整理汇总了PHP中Toolbar::cancel方法的典型用法代码示例。如果您正苦于以下问题:PHP Toolbar::cancel方法的具体用法?PHP Toolbar::cancel怎么用?PHP Toolbar::cancel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Toolbar
的用法示例。
在下文中一共展示了Toolbar::cancel方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addToolbar
/**
* Add the page title and toolbar.
*
* @since 1.6
*/
protected function addToolbar()
{
Request::setVar('hidemainmenu', 1);
$user = JFactory::getUser();
$isNew = $this->item->id == 0;
$canDo = UsersHelper::getActions();
Toolbar::title(Lang::txt($isNew ? 'COM_USERS_VIEW_NEW_LEVEL_TITLE' : 'COM_USERS_VIEW_EDIT_LEVEL_TITLE'), 'levels-add');
if ($canDo->get('core.edit') || $canDo->get('core.create')) {
Toolbar::apply('level.apply');
Toolbar::save('level.save');
}
if ($canDo->get('core.create')) {
Toolbar::save2new('level.save2new');
}
// If an existing item, can save to a copy.
if (!$isNew && $canDo->get('core.create')) {
Toolbar::save2copy('level.save2copy');
}
if (empty($this->item->id)) {
Toolbar::cancel('level.cancel');
} else {
Toolbar::cancel('level.cancel', 'JTOOLBAR_CLOSE');
}
Toolbar::divider();
Toolbar::help('level');
}
示例2: addToolbar
/**
* Add the page title and toolbar.
*
* @since 1.6
*/
protected function addToolbar()
{
Request::setVar('hidemainmenu', true);
$userId = User::get('id');
$isNew = $this->item->id == 0;
$checkedOut = !($this->item->checked_out == 0 || $this->item->checked_out == User::get('id'));
// Since we don't track these assets at the item level, use the category id.
$canDo = NewsfeedsHelper::getActions($this->item->catid, 0);
Toolbar::title(Lang::txt('COM_NEWSFEEDS_MANAGER_NEWSFEED'), 'newsfeeds.png');
// If not checked out, can save the item.
if (!$checkedOut && ($canDo->get('core.edit') || count(User::getAuthorisedCategories('com_newsfeeds', 'core.create')) > 0)) {
Toolbar::apply('newsfeed.apply');
Toolbar::save('newsfeed.save');
}
if (!$checkedOut && count(User::getAuthorisedCategories('com_newsfeeds', 'core.create')) > 0) {
Toolbar::save2new('newsfeed.save2new');
}
// If an existing item, can save to a copy.
if (!$isNew && $canDo->get('core.create')) {
Toolbar::save2copy('newsfeed.save2copy');
}
if (empty($this->item->id)) {
Toolbar::cancel('newsfeed.cancel');
} else {
Toolbar::cancel('newsfeed.cancel', 'JTOOLBAR_CLOSE');
}
Toolbar::divider();
Toolbar::help('JHELP_COMPONENTS_NEWSFEEDS_FEEDS_EDIT');
}
示例3: addToolbar
/**
* Add the page title and toolbar.
*
* @since 1.6
*/
protected function addToolbar()
{
require_once JPATH_COMPONENT . '/helpers/languages.php';
Request::setVar('hidemainmenu', 1);
$isNew = empty($this->item->lang_id);
$canDo = LanguagesHelper::getActions();
Toolbar::title(Lang::txt($isNew ? 'COM_LANGUAGES_VIEW_LANGUAGE_EDIT_NEW_TITLE' : 'COM_LANGUAGES_VIEW_LANGUAGE_EDIT_EDIT_TITLE'), 'langmanager.png');
// If a new item, can save.
if ($isNew && $canDo->get('core.create')) {
Toolbar::save('language.save');
}
//If an existing item, allow to Apply and Save.
if (!$isNew && $canDo->get('core.edit')) {
Toolbar::apply('language.apply');
Toolbar::save('language.save');
}
// If an existing item, can save to a copy only if we have create rights.
if ($canDo->get('core.create')) {
Toolbar::save2new('language.save2new');
}
if ($isNew) {
Toolbar::cancel('language.cancel');
} else {
Toolbar::cancel('language.cancel', 'JTOOLBAR_CLOSE');
}
Toolbar::divider();
Toolbar::help('language');
}
示例4: addToolbar
/**
* Add the page title and toolbar.
*
* @since 1.6
*/
protected function addToolbar()
{
Request::setVar('hidemainmenu', true);
$isNew = $this->item->id == 0;
$canDo = TemplatesHelper::getActions();
Toolbar::title($isNew ? Lang::txt('COM_TEMPLATES_MANAGER_ADD_STYLE') : Lang::txt('COM_TEMPLATES_MANAGER_EDIT_STYLE'), 'thememanager');
// If not checked out, can save the item.
if ($canDo->get('core.edit')) {
Toolbar::apply('style.apply');
Toolbar::save('style.save');
}
// If an existing item, can save to a copy.
if (!$isNew && $canDo->get('core.create')) {
Toolbar::save2copy('style.save2copy');
}
if (empty($this->item->id)) {
Toolbar::cancel('style.cancel');
} else {
Toolbar::cancel('style.cancel', 'JTOOLBAR_CLOSE');
}
Toolbar::divider();
// Get the help information for the template item.
$lang = Lang::getRoot();
$help = $this->get('Help');
if ($lang->hasKey($help->url)) {
$debug = $lang->setDebug(false);
$url = Lang::txt($help->url);
$lang->setDebug($debug);
} else {
$url = null;
}
Toolbar::help('style');
//$help->key, false, $url);
}
示例5: addToolbar
/**
* Add the page title and toolbar.
*
* @since 1.6
*/
protected function addToolbar()
{
Request::setVar('hidemainmenu', true);
$isNew = $this->item->id == 0;
$canDo = MenusHelper::getActions($this->state->get('filter.parent_id'));
Toolbar::title(Lang::txt($isNew ? 'COM_MENUS_VIEW_NEW_MENU_TITLE' : 'COM_MENUS_VIEW_EDIT_MENU_TITLE'), 'menu.png');
// If a new item, can save the item. Allow users with edit permissions to apply changes to prevent returning to grid.
if ($isNew && $canDo->get('core.create')) {
if ($canDo->get('core.edit')) {
Toolbar::apply('menu.apply');
}
Toolbar::save('menu.save');
}
// If user can edit, can save the item.
if (!$isNew && $canDo->get('core.edit')) {
Toolbar::apply('menu.apply');
Toolbar::save('menu.save');
}
// If the user can create new items, allow them to see Save & New
if ($canDo->get('core.create')) {
Toolbar::save2new('menu.save2new');
}
if ($isNew) {
Toolbar::cancel('menu.cancel');
} else {
Toolbar::cancel('menu.cancel', 'JTOOLBAR_CLOSE');
}
Toolbar::divider();
Toolbar::help('menu');
}
示例6: addToolbar
/**
* Add the page title and toolbar.
*
* @since 1.6
*/
protected function addToolbar()
{
Request::setVar('hidemainmenu', 1);
Toolbar::title(Lang::txt('COM_ADMIN_VIEW_PROFILE_TITLE'), 'user-profile');
Toolbar::apply('profile.apply');
Toolbar::save('profile.save');
Toolbar::cancel('profile.cancel', 'JTOOLBAR_CLOSE');
Toolbar::divider();
Toolbar::help('JHELP_ADMIN_USER_PROFILE_EDIT');
}
示例7: addToolbar
/**
* Add the page title and toolbar.
*
* @since 1.6
*/
protected function addToolbar()
{
if ($this->getLayout() == 'edit') {
Toolbar::title(Lang::txt('COM_MESSAGES_WRITE_PRIVATE_MESSAGE'), 'new-privatemessage.png');
Toolbar::save('message.save', 'COM_MESSAGES_TOOLBAR_SEND');
Toolbar::cancel('message.cancel');
Toolbar::help('JHELP_COMPONENTS_MESSAGING_WRITE');
} else {
Toolbar::title(Lang::txt('COM_MESSAGES_VIEW_PRIVATE_MESSAGE'), 'inbox.png');
$sender = JUser::getInstance($this->item->user_id_from);
if ($sender->authorise('core.admin') || $sender->authorise('core.manage', 'com_messages') && $sender->authorise('core.login.admin')) {
Toolbar::custom('message.reply', 'restore.png', 'restore_f2.png', 'COM_MESSAGES_TOOLBAR_REPLY', false);
}
Toolbar::cancel('message.cancel');
Toolbar::help('JHELP_COMPONENTS_MESSAGING_READ');
}
}
示例8: addToolbar
/**
* Add the page title and toolbar.
*
* @since 1.6
*/
protected function addToolbar()
{
Request::setVar('hidemainmenu', true);
$isNew = $this->item->id == 0;
$checkedOut = !($this->item->checked_out == 0 || $this->item->checked_out == User::get('id'));
$canDo = ModulesHelper::getActions($this->state->get('filter.category_id'), $this->item->id);
$item = $this->get('Item');
Toolbar::title(Lang::txt('COM_MODULES_MANAGER_MODULE', Lang::txt($this->item->module)), 'module.png');
// If not checked out, can save the item.
if (!$checkedOut && ($canDo->get('core.edit') || $canDo->get('core.create'))) {
Toolbar::apply('module.apply');
Toolbar::save('module.save');
}
if (!$checkedOut && $canDo->get('core.create')) {
Toolbar::save2new('module.save2new');
}
// If an existing item, can save to a copy.
if (!$isNew && $canDo->get('core.create')) {
Toolbar::save2copy('module.save2copy');
}
if (empty($this->item->id)) {
Toolbar::cancel('module.cancel');
} else {
Toolbar::cancel('module.cancel', 'JTOOLBAR_CLOSE');
}
// Get the help information for the menu item.
$lang = Lang::getRoot();
$help = $this->get('Help');
if ($lang->hasKey($help->url)) {
$debug = $lang->setDebug(false);
$url = Lang::txt($help->url);
$lang->setDebug($debug);
} else {
$url = null;
}
Toolbar::help('module');
//$help->key, false, $url);
}
示例9: addToolbar
/**
* Add the page title and toolbar.
*
* @since 1.6
*/
protected function addToolbar()
{
Request::setVar('hidemainmenu', true);
$userId = User::get('id');
$isNew = $this->item->id == 0;
$checkedOut = !($this->item->checked_out == 0 || $this->item->checked_out == $userId);
$canDo = ContentHelper::getActions($this->state->get('filter.category_id'), $this->item->id);
Toolbar::title(Lang::txt('COM_CONTENT_PAGE_' . ($checkedOut ? 'VIEW_ARTICLE' : ($isNew ? 'ADD_ARTICLE' : 'EDIT_ARTICLE'))), 'article-add.png');
// Built the actions for new and existing records.
// For new records, check the create permission.
if ($isNew && count(User::getAuthorisedCategories('com_content', 'core.create')) > 0) {
Toolbar::apply('article.apply');
Toolbar::save('article.save');
Toolbar::save2new('article.save2new');
Toolbar::cancel('article.cancel');
} else {
// Can't save the record if it's checked out.
if (!$checkedOut) {
// Since it's an existing record, check the edit permission, or fall back to edit own if the owner.
if ($canDo->get('core.edit') || $canDo->get('core.edit.own') && $this->item->created_by == $userId) {
Toolbar::apply('article.apply');
Toolbar::save('article.save');
// We can save this record, but check the create permission to see if we can return to make a new one.
if ($canDo->get('core.create')) {
Toolbar::save2new('article.save2new');
}
}
}
// If checked out, we can still save
if ($canDo->get('core.create')) {
Toolbar::save2copy('article.save2copy');
}
Toolbar::cancel('article.cancel', 'JTOOLBAR_CLOSE');
}
Toolbar::divider();
Toolbar::help('article');
}
示例10: defined
*
* @package hubzero-cms
* @copyright Copyright 2005-2015 HUBzero Foundation, LLC.
* @license http://opensource.org/licenses/MIT MIT
*/
// No direct access
defined('_HZEXEC_') or die;
$canDo = \Components\Collections\Helpers\Permissions::getActions('post');
$text = $this->task == 'edit' ? Lang::txt('JACTION_EDIT') : Lang::txt('JACTION_CREATE');
Toolbar::title(Lang::txt('COM_COLLECTIONS') . ': ' . Lang::txt('COM_COLLECTIONS_POSTS') . ': ' . $text, 'collection.png');
if ($canDo->get('core.edit')) {
Toolbar::apply();
Toolbar::save();
Toolbar::spacer();
}
Toolbar::cancel();
Toolbar::spacer();
Toolbar::help('collection');
if (!$this->row->get('id')) {
$this->row->set('created_by', User::get('id'));
$this->row->set('created', Date::toSql());
}
?>
<script type="text/javascript">
function submitbutton(pressbutton)
{
var form = document.adminForm;
if (pressbutton == 'cancel') {
submitform(pressbutton);
return;
示例11: defined
* THE SOFTWARE.
*
* HUBzero is a registered trademark of Purdue University.
*
* @package hubzero-cms
* @author Shawn Rice <zooley@purdue.edu>
* @copyright Copyright 2005-2015 HUBzero Foundation, LLC.
* @license http://opensource.org/licenses/MIT MIT
*/
// No direct access
defined('_HZEXEC_') or die;
Toolbar::title(Lang::txt('COM_CONFIG_GLOBAL_CONFIGURATION'), 'config.png');
Toolbar::apply('application.apply');
Toolbar::save('application.save');
Toolbar::divider();
Toolbar::cancel('application.cancel');
Toolbar::divider();
Toolbar::help('global_config');
// Load tooltips behavior
Html::behavior('formvalidation');
Html::behavior('switcher', 'submenu');
Html::behavior('tooltip');
// Load submenu template, using element id 'submenu' as needed by behavior.switcher
$this->document->setBuffer($this->loadTemplate('navigation'), 'modules', 'submenu');
?>
<script type="text/javascript">
Joomla.submitbutton = function(task)
{
if (task == 'application.cancel' || document.formvalidator.isValid($('#application-form'))) {
Joomla.submitform(task, document.getElementById('application-form'));
}
示例12: defined
*
* @package hubzero-cms
* @copyright Copyright 2005-2015 HUBzero Foundation, LLC.
* @license http://opensource.org/licenses/MIT MIT
*/
// No direct access
defined('_HZEXEC_') or die;
$canDo = Components\Members\Helpers\Admin::getActions('component');
$text = $this->task == 'editClass' ? Lang::txt('JACTION_EDIT') : Lang::txt('JACTION_CREATE');
Toolbar::title(Lang::txt('COM_MEMBERS_QUOTA_CLASSES') . ': ' . $text, 'user');
if ($canDo->get('core.edit')) {
Toolbar::apply('applyClass');
Toolbar::save('saveClass');
Toolbar::spacer();
}
Toolbar::cancel('cancelClass');
?>
<script type="text/javascript">
function submitbutton(pressbutton)
{
var form = document.adminForm;
if (pressbutton == 'cancel') {
submitform( pressbutton );
return;
}
submitform( pressbutton );
}
</script>
示例13: function
if ($canDo->get('core.edit')) {
Toolbar::apply();
Toolbar::save();
}
// This component does not support Save as Copy due to uniqueness checks.
// While it can be done, it causes too much confusion if the user does
// not change the Old URL.
if ($canDo->get('core.edit') && $canDo->get('core.create')) {
Toolbar::save2new();
}
if (empty($this->item->id)) {
Toolbar::spacer();
Toolbar::cancel('cancel');
} else {
Toolbar::spacer();
Toolbar::cancel('cancel', 'JTOOLBAR_CLOSE');
}
Toolbar::spacer();
Toolbar::help('link');
// Include the HTML helpers.
Html::addIncludePath(dirname(JPATH_COMPONENT) . '/helpers/html');
Html::behavior('tooltip');
Html::behavior('formvalidation');
Html::behavior('keepalive');
?>
<script type="text/javascript">
Joomla.submitbutton = function(task) {
if (task == 'cancel' || document.formvalidator.isValid($('#item-form'))) {
Joomla.submitform(task, document.getElementById('item-form'));
}
}
示例14: defined
* THE SOFTWARE.
*
* HUBzero is a registered trademark of Purdue University.
*
* @package hubzero-cms
* @copyright Copyright 2005-2015 HUBzero Foundation, LLC.
* @license http://opensource.org/licenses/MIT MIT
*/
// No direct access.
defined('_HZEXEC_') or die;
$text = $this->task == 'edit' ? Lang::txt('JACTION_EDIT') : Lang::txt('JACTION_CREATE');
Toolbar::title(Lang::txt('COM_TOOLS_SESSION_CLASSES') . ': ' . $text, 'user.png');
Toolbar::apply();
Toolbar::save();
Toolbar::spacer();
Toolbar::cancel('cancelclass');
?>
<script type="text/javascript">
function submitbutton(pressbutton)
{
var form = document.adminForm;
if (pressbutton == 'cancel') {
submitform( pressbutton );
return;
}
submitform( pressbutton );
}
</script>
示例15: addToolbar
/**
* Add the page title and toolbar.
*
* @since 1.6
*/
protected function addToolbar()
{
// Initialise variables.
$extension = Request::getCmd('extension');
$userId = User::get('id');
$isNew = $this->item->id == 0;
$checkedOut = !($this->item->checked_out == 0 || $this->item->checked_out == $userId);
// Avoid nonsense situation.
if ($extension == 'com_categories') {
return;
}
// The extension can be in the form com_foo.section
$parts = explode('.', $extension);
$component = $parts[0];
$section = count($parts) > 1 ? $parts[1] : null;
// Need to load the menu language file as mod_menu hasn't been loaded yet.
$lang = Lang::getRoot();
$lang->load($component, JPATH_BASE, null, false, false) || $lang->load($component, PATH_CORE . '/components/' . $component . '/admin', null, false, false) || $lang->load($component, JPATH_BASE, $lang->getDefault(), false, false) || $lang->load($component, PATH_CORE . '/components/' . $component . '/admin', $lang->getDefault(), false, false);
// Load the category helper.
require_once JPATH_COMPONENT . '/helpers/categories.php';
// Get the results for each action.
$canDo = CategoriesHelper::getActions($component, $this->item->id);
// If a component categories title string is present, let's use it.
if ($lang->hasKey($component_title_key = $component . ($section ? "_{$section}" : '') . '_CATEGORY_' . ($isNew ? 'ADD' : 'EDIT') . '_TITLE')) {
$title = Lang::txt($component_title_key);
} elseif ($lang->hasKey($component_section_key = $component . ($section ? "_{$section}" : ''))) {
$title = Lang::txt('COM_CATEGORIES_CATEGORY_' . ($isNew ? 'ADD' : 'EDIT') . '_TITLE', $this->escape(Lang::txt($component_section_key)));
} else {
$title = Lang::txt('COM_CATEGORIES_CATEGORY_BASE_' . ($isNew ? 'ADD' : 'EDIT') . '_TITLE');
}
// Load specific css component
Html::asset('stylesheet', $component . '/administrator/categories.css', array(), true);
// Prepare the toolbar.
Toolbar::title($title, 'category-' . ($isNew ? 'add' : 'edit') . ' ' . substr($component, 4) . ($section ? "-{$section}" : '') . '-category-' . ($isNew ? 'add' : 'edit'));
// For new records, check the create permission.
if ($isNew && count(User::getAuthorisedCategories($component, 'core.create')) > 0) {
Toolbar::apply('category.apply');
Toolbar::save('category.save');
Toolbar::save2new('category.save2new');
} elseif (!$checkedOut && ($canDo->get('core.edit') || $canDo->get('core.edit.own') && $this->item->created_user_id == $userId)) {
Toolbar::apply('category.apply');
Toolbar::save('category.save');
if ($canDo->get('core.create')) {
Toolbar::save2new('category.save2new');
}
}
// If an existing item, can save to a copy.
if (!$isNew && $canDo->get('core.create')) {
Toolbar::save2copy('category.save2copy');
}
if (empty($this->item->id)) {
Toolbar::cancel('category.cancel');
} else {
Toolbar::cancel('category.cancel', 'JTOOLBAR_CLOSE');
}
Toolbar::divider();
// Compute the ref_key if it does exist in the component
if (!$lang->hasKey($ref_key = strtoupper($component . ($section ? "_{$section}" : '')) . '_CATEGORY_' . ($isNew ? 'ADD' : 'EDIT') . '_HELP_KEY')) {
$ref_key = 'JHELP_COMPONENTS_' . strtoupper(substr($component, 4) . ($section ? "_{$section}" : '')) . '_CATEGORY_' . ($isNew ? 'ADD' : 'EDIT');
}
// Get help for the category/section view for the component by
// -remotely searching in a language defined dedicated URL: *component*_HELP_URL
// -locally searching in a component help file if helpURL param exists in the component and is set to ''
// -remotely searching in a component URL if helpURL param exists in the component and is NOT set to ''
if ($lang->hasKey($lang_help_url = strtoupper($component) . '_HELP_URL')) {
$debug = $lang->setDebug(false);
$url = Lang::txt($lang_help_url);
$lang->setDebug($debug);
} else {
$url = null;
}
Toolbar::help('category');
//$ref_key, Component::params( $component )->exists('helpURL'), $url, $component);
}