本文整理汇总了PHP中JToolBarHelper::save方法的典型用法代码示例。如果您正苦于以下问题:PHP JToolBarHelper::save方法的具体用法?PHP JToolBarHelper::save怎么用?PHP JToolBarHelper::save使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JToolBarHelper
的用法示例。
在下文中一共展示了JToolBarHelper::save方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addToolbar
/**
* Add the page title and toolbar.
*/
protected function addToolbar()
{
JFactory::getApplication()->input->set('hidemainmenu', true);
$user = JFactory::getUser();
$isNew = $this->item->id == 0;
if (isset($this->item->checked_out)) {
$checkedOut = !($this->item->checked_out == 0 || $this->item->checked_out == $user->get('id'));
} else {
$checkedOut = false;
}
$canDo = SomosmaestrosHelper::getActions();
JToolBarHelper::title(JText::_('COM_SOMOSMAESTROS_TITLE_FORMACION'), 'formacion.png');
// If not checked out, can save the item.
if (!$checkedOut && ($canDo->get('core.edit') || $canDo->get('core.create'))) {
JToolBarHelper::apply('formacion.apply', 'JTOOLBAR_APPLY');
JToolBarHelper::save('formacion.save', 'JTOOLBAR_SAVE');
}
if (!$checkedOut && $canDo->get('core.create')) {
JToolBarHelper::custom('formacion.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
}
// If an existing item, can save to a copy.
if (!$isNew && $canDo->get('core.create')) {
JToolBarHelper::custom('formacion.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false);
}
if (empty($this->item->id)) {
JToolBarHelper::cancel('formacion.cancel', 'JTOOLBAR_CANCEL');
} else {
JToolBarHelper::cancel('formacion.cancel', 'JTOOLBAR_CLOSE');
}
}
示例2: addToolbar
/**
* Add the page title and toolbar.
*/
protected function addToolbar()
{
JFactory::getApplication()->input->set('hidemainmenu', true);
$user = JFactory::getUser();
$isNew = $this->item->id == 0;
$checkedOut = !($this->item->checked_out == 0 || $this->item->checked_out == $user->get('id'));
$canDo = SibdietHelper::getActions();
JToolBarHelper::title(JText::_('COM_SIBDIET_MANAGER_ERRAND'), 'database errands');
// If not checked out, can save the item.
if (!$checkedOut && ($canDo->get('core.edit') || $canDo->get('core.create'))) {
JToolBarHelper::apply('errand.apply');
JToolBarHelper::save('errand.save');
}
if (!$checkedOut && $canDo->get('core.create')) {
JToolbarHelper::save2new('errand.save2new');
}
// If an existing item, can save to a copy.
if (!$isNew && $canDo->get('core.create')) {
JToolbarHelper::save2copy('errand.save2copy');
}
if (empty($this->item->id)) {
JToolBarHelper::cancel('errand.cancel');
} else {
JToolBarHelper::cancel('errand.cancel', 'JTOOLBAR_CLOSE');
}
}
示例3: edit
function edit()
{
JToolBarHelper::save();
JToolBarHelper::cancel();
JRequest::setVar('view', 'careerleveledit');
parent::display();
}
示例4: addToolbar
/**
* Add the page title and toolbar.
*
* @since 1.6
*/
protected function addToolbar()
{
JRequest::setVar('hidemainmenu', true);
$user = JFactory::getUser();
$isNew = $this->item->id == 0;
$checkedOut = !($this->item->checked_out == 0 || $this->item->checked_out == $user->get('id'));
$canDo = NewsfeedsHelper::getActions($this->state->get('filter.category_id'), $this->item->id);
JToolBarHelper::title(JText::_('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)) {
JToolBarHelper::apply('newsfeed.apply', 'JTOOLBAR_APPLY');
JToolBarHelper::save('newsfeed.save', 'JTOOLBAR_SAVE');
}
if (!$checkedOut && count($user->getAuthorisedCategories('com_newsfeeds', 'core.create')) > 0) {
JToolBarHelper::custom('newsfeed.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
}
// If an existing item, can save to a copy.
if (!$isNew && $canDo->get('core.create')) {
JToolBarHelper::custom('newsfeed.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false);
}
if (empty($this->item->id)) {
JToolBarHelper::cancel('newsfeed.cancel', 'JTOOLBAR_CANCEL');
} else {
JToolBarHelper::cancel('newsfeed.cancel', 'JTOOLBAR_CLOSE');
}
JToolBarHelper::divider();
JToolBarHelper::help('JHELP_COMPONENTS_NEWSFEEDS_FEEDS_EDIT');
}
示例5: display
function display($tpl = null)
{
$prod =& $this->get('Data');
$isNew = $prod->id < 1;
$text = $isNew ? JText::_("NEW") : JText::_("EDIT");
JToolBarHelper::title(JText::_("PRODUCT") . ': <small><small>[ ' . $text . ' ]</small></small>', 'fst_prods');
if (FST_Helper::Is16()) {
JToolBarHelper::custom('translate', 'translate', 'translate', 'Translate', false);
JToolBarHelper::spacer();
}
JToolBarHelper::save();
if ($isNew) {
JToolBarHelper::cancel();
} else {
// for existing items the button is renamed `close`
JToolBarHelper::cancel('cancel', 'Close');
}
FSTAdminHelper::DoSubToolbar();
$this->assignRef('prod', $prod);
$path = JPATH_SITE . DS . 'images' . DS . 'fst' . DS . 'products';
if (!file_exists($path)) {
mkdir($path, 0777, true);
}
$files = JFolder::files($path, '(.png$|.jpg$|.jpeg$|.gif$)');
$sections[] = JHTML::_('select.option', '', JText::_("NO_IMAGE"), 'id', 'title');
foreach ($files as $file) {
$sections[] = JHTML::_('select.option', $file, $file, 'id', 'title');
}
$lists['images'] = JHTML::_('select.genericlist', $sections, 'image', 'class="inputbox" size="1" ', 'id', 'title', $prod->image);
$this->assignRef('lists', $lists);
parent::display($tpl);
}
示例6: display
function display($tpl = null)
{
$entry = $this->get('Data');
$characters_length = $this->get('CharactersLength');
$robots_array = array('', 'index, follow', 'noindex, follow', 'index, nofollow', 'noindex, nofollow');
if (empty($entry->id)) {
JToolBarHelper::title(JText::_('COM_EASYFRONTENDSEO') . ' - ' . JText::_('COM_EASYFRONTENDSEO_NEWENTRY'), 'easyfrontendseo-add');
JToolBarHelper::save('save');
JToolBarHelper::cancel('cancel');
} else {
JToolBarHelper::title(JText::_('COM_EASYFRONTENDSEO') . ' - ' . JText::_('COM_EASYFRONTENDSEO_EDITENTRY'), 'easyfrontendseo-edit');
JToolbarHelper::apply('apply');
JToolBarHelper::save('save');
JToolBarHelper::cancel('cancel', 'Close');
}
JHTML::_('behavior.framework');
$document = JFactory::getDocument();
$document->addStyleSheet('components/com_easyfrontendseo/css/easyfrontendseo.css');
$document->addScript('components/com_easyfrontendseo/js/wordcount.js', 'text/javascript');
$output = "window.addEvent('domready', function(){";
$output .= "new WordCount('counter_title', {inputName:'title', wordText:'" . JText::_('COM_EASYFRONTENDSEO_WORDS') . "', charText:'" . JText::_('COM_EASYFRONTENDSEO_CHARACTERS') . "'}); new WordCount('counter_title', {inputName:'title', eventTrigger: 'click', wordText:'" . JText::_('COM_EASYFRONTENDSEO_WORDS') . "', charText:'" . JText::_('COM_EASYFRONTENDSEO_CHARACTERS') . "'});\n";
$output .= "new WordCount('counter_description', {inputName:'description', wordText:'" . JText::_('COM_EASYFRONTENDSEO_WORDS') . "', charText:'" . JText::_('COM_EASYFRONTENDSEO_CHARACTERS') . "'}); new WordCount('counter_description', {inputName:'description', eventTrigger: 'click', wordText:'" . JText::_('COM_EASYFRONTENDSEO_WORDS') . "', charText:'" . JText::_('COM_EASYFRONTENDSEO_CHARACTERS') . "'});\n";
$output .= "new WordCount('counter_keywords', {inputName:'keywords', wordText:'" . JText::_('COM_EASYFRONTENDSEO_WORDS') . "', charText:'" . JText::_('COM_EASYFRONTENDSEO_CHARACTERS') . "'}); new WordCount('counter_keywords', {inputName:'keywords', eventTrigger: 'click', wordText:'" . JText::_('COM_EASYFRONTENDSEO_WORDS') . "', charText:'" . JText::_('COM_EASYFRONTENDSEO_CHARACTERS') . "'});\n";
$output .= "new WordCount('counter_generator', {inputName:'generator', wordText:'" . JText::_('COM_EASYFRONTENDSEO_WORDS') . "', charText:'" . JText::_('COM_EASYFRONTENDSEO_CHARACTERS') . "'}); new WordCount('counter_generator', {inputName:'generator', eventTrigger: 'click', wordText:'" . JText::_('COM_EASYFRONTENDSEO_WORDS') . "', charText:'" . JText::_('COM_EASYFRONTENDSEO_CHARACTERS') . "'});\n";
$output .= " });";
$document->addScriptDeclaration($output, 'text/javascript');
$this->entry = $entry;
$this->characters_length = $characters_length;
$this->robots_array = $robots_array;
// Get donation code message
require_once JPATH_COMPONENT . '/helpers/easyfrontendseo.php';
$donation_code_message = EasyFrontendSeoHelper::getDonationCodeMessage();
$this->donation_code_message = $donation_code_message;
parent::display($tpl);
}
示例7: displayEdit
function displayEdit($tpl = null)
{
JToolBarHelper::title($this->order->order_number, 'generic.png');
JToolBarHelper::save();
JToolBarHelper::cancel();
parent::display($tpl);
}
示例8: addToolbar
/**
* Add the page title and toolbar.
*
*/
protected function addToolbar()
{
JRequest::setVar('hidemainmenu', true);
$uid = JFactory::getUser()->get('id');
$access = PFtasksHelper::getListActions($this->item->id);
$checked_out = !($this->item->checked_out == 0 || $this->item->checked_out == $uid);
$is_new = $this->item->id == 0;
JToolBarHelper::title(JText::_('COM_PROJECTFORK_PAGE_' . ($checked_out ? 'VIEW_TASKLIST' : ($is_new ? 'ADD_TASKLIST' : 'EDIT_TASKLIST'))), 'article-add.png');
// Built the actions for new and existing records.
// For new records, check the create permission.
if ($is_new) {
JToolBarHelper::apply('tasklist.apply');
JToolBarHelper::save('tasklist.save');
JToolBarHelper::save2new('tasklist.save2new');
JToolBarHelper::cancel('tasklist.cancel');
} else {
// Can't save the record if it's checked out.
if (!$checked_out) {
if ($access->get('core.edit') || $access->get('core.edit.own') && $this->item->created_by == $uid) {
JToolBarHelper::apply('tasklist.apply');
JToolBarHelper::save('tasklist.save');
JToolBarHelper::save2new('tasklist.save2new');
}
}
JToolBarHelper::save2copy('tasklist.save2copy');
JToolBarHelper::cancel('tasklist.cancel', 'JTOOLBAR_CLOSE');
}
}
示例9: __construct
function __construct($default = array())
{
parent::__construct($default);
$task = JRequest::getWord('task', '');
switch ($task) {
case 'add':
case 'save':
case 'apply':
case 'edit':
JToolBarHelper::apply();
JToolBarHelper::save();
JToolBarHelper::cancel();
break;
default:
JToolBarHelper::addNew();
JToolBarHelper::deleteList();
JToolBarHelper::makeDefault('publish');
break;
}
// Register Extra tasks
JRequest::setVar('view', 'services');
$this->registerTask('add', 'edit');
$this->registerTask('apply', 'save');
$this->registerTask('publish', 'setDefault');
}
示例10: addToolBar
/**
* Setting the toolbar
*/
protected function addToolBar()
{
JRequest::setVar('hidemainmenu', true);
$user = JFactory::getUser();
$userId = $user->id;
$isNew = $this->item->id == 0;
$canDo = MailUPHelper::getActions($this->item->id);
JToolBarHelper::title($isNew ? JText::_('COM_MAILUP_MANAGER_MAILUP_NEW') : JText::_('COM_MAILUP_MANAGER_MAILUP_EDIT'), 'group');
// Built the actions for new and existing records.
if ($isNew) {
// For new records, check the create permission.
if ($canDo->get('core.create')) {
//JToolBarHelper::apply('group.save', 'JTOOLBAR_APPLY');
JToolBarHelper::save('group.applyGroup', 'JTOOLBAR_SAVE');
//JToolBarHelper::custom('group.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
}
JToolBarHelper::cancel('group.cancel', 'JTOOLBAR_CANCEL');
} else {
if ($canDo->get('core.edit')) {
// We can save the new record
//JToolBarHelper::apply('group.save', 'JTOOLBAR_APPLY');
JToolBarHelper::save('group.updateGroup', 'JTOOLBAR_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')) {
//JToolBarHelper::custom('group.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
}
}
if ($canDo->get('core.create')) {
//JToolBarHelper::custom('group.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false);
}
JToolBarHelper::cancel('group.cancel', 'JTOOLBAR_CLOSE');
}
}
示例11: toolbar
function toolbar()
{
switch (JRequest::getCmd('task')) {
case 'edit':
case 'apply':
case 'add':
switch (JRequest::getCmd('task')) {
case 'add':
JToolBarHelper::title(JText::_('COM_REDFORM_Add_Value'), 'redform_plus');
break;
default:
JToolBarHelper::title(JText::_('COM_REDFORM_Edit_Value'), 'redform_plus');
break;
}
JToolBarHelper::save();
JToolBarHelper::apply();
JToolBarHelper::cancel();
break;
default:
JToolBarHelper::title(JText::_('COM_REDFORM_Values'), 'redform_values');
if ($this->get('Total', 'fields') > 0) {
JToolBarHelper::publishList();
JToolBarHelper::unpublishList();
JToolBarHelper::spacer();
JToolBarHelper::deleteList();
JToolBarHelper::editListX();
JToolBarHelper::addNew();
}
break;
}
}
示例12: addToolbar
/**
* Add the page title and toolbar.
*
* @since 1.6
*/
protected function addToolbar()
{
JRequest::setVar('hidemainmenu', true);
$user = JFactory::getUser();
$isNew = $this->item->id == 0;
$checkedOut = !($this->item->checked_out == 0 || $this->item->checked_out == $user->get('id'));
$canDo = BannersHelper::getActions();
JToolBarHelper::title($isNew ? JText::_('COM_BANNERS_MANAGER_CLIENT_NEW') : JText::_('COM_BANNERS_MANAGER_CLIENT_EDIT'), 'banners-clients.png');
// If not checked out, can save the item.
if (!$checkedOut && ($canDo->get('core.edit') || $canDo->get('core.create'))) {
JToolBarHelper::apply('client.apply');
JToolBarHelper::save('client.save');
}
if (!$checkedOut && $canDo->get('core.create')) {
JToolBarHelper::save2new('client.save2new');
}
// If an existing item, can save to a copy.
if (!$isNew && $canDo->get('core.create')) {
JToolBarHelper::save2copy('client.save2copy');
}
if (empty($this->item->id)) {
JToolBarHelper::cancel('client.cancel');
} else {
JToolBarHelper::cancel('client.cancel', 'JTOOLBAR_CLOSE');
}
JToolBarHelper::divider();
JToolBarHelper::help('JHELP_COMPONENTS_BANNERS_CLIENTS_EDIT');
}
示例13: addButton
public static function addButton()
{
$task = JRequest::getVar('task');
$controller = JRequest::getVar('controller');
switch (strtoupper($controller)) {
case 'LOAINHA':
$title = 'Loại nhà';
break;
case 'CAPCONGTRINH':
$title = 'Cấp công trình';
break;
case 'TAISAN':
$title = 'Tài sản';
break;
default:
$title = '';
break;
}
switch ($task) {
case 'add':
case 'edit':
JToolBarHelper::save('save', 'Lưu và đóng');
JToolBarHelper::cancel('cancel', 'Huỷ bỏ');
break;
default:
JToolBarHelper::title(JText::_('Danh mục ' . $title . ': [Danh sách]'), 'generic.png');
JToolBarHelper::addNew('add', 'Thêm mới');
JToolBarHelper::deleteList(null, 'remove', 'Xóa');
JToolBarHelper::publish('publish', 'Bật trạng thái');
JToolBarHelper::unpublish('unpublish', 'Tắt trạng thái');
break;
}
}
示例14: addToolbar
protected function addToolbar()
{
require_once JPATH_COMPONENT . '/helpers/jcomments.php';
JFactory::getApplication()->input->set('hidemainmenu', 1);
$userId = JFactory::getUser()->get('id');
$canDo = JCommentsHelper::getActions();
$isNew = $this->item->id == 0;
$checkedOut = !($this->item->checked_out == 0 || $this->item->checked_out == $userId);
if (version_compare(JVERSION, '3.0', 'ge')) {
JToolbarHelper::title($isNew ? JText::_('A_SMILIES_SMILEY_NEW') : JText::_('A_SMILIES_SMILEY_EDIT'), 'smilies.png');
} else {
JToolbarHelper::title($isNew ? JText::_('A_SMILIES_SMILEY_NEW') : JText::_('A_SMILIES_SMILEY_EDIT'), 'jcomments-smilies');
}
if (!$checkedOut && $canDo->get('core.edit')) {
JToolBarHelper::apply('smiley.apply');
JToolBarHelper::save('smiley.save');
}
if (!$isNew && $canDo->get('core.create')) {
JToolbarHelper::save2new('smiley.save2new');
}
if ($isNew) {
JToolBarHelper::cancel('smiley.cancel');
} else {
JToolBarHelper::cancel('smiley.cancel', 'JTOOLBAR_CLOSE');
}
}
示例15: addToolbar
/**
* Add the page title and toolbar.
*
* @since 1.6
*/
protected function addToolbar()
{
JRequest::setVar('hidemainmenu', 1);
$user = JFactory::getUser();
$isNew = $this->item->id == 0;
$canDo = UsersHelper::getActions();
JToolBarHelper::title(JText::_($isNew ? 'COM_USERS_VIEW_NEW_GROUP_TITLE' : 'COM_USERS_VIEW_EDIT_GROUP_TITLE'), 'groups-add');
if ($canDo->get('core.edit') || $canDo->get('core.create')) {
JToolBarHelper::apply('group.apply');
JToolBarHelper::save('group.save');
}
if ($canDo->get('core.create')) {
JToolBarHelper::save2new('group.save2new');
}
// If an existing item, can save to a copy.
if (!$isNew && $canDo->get('core.create')) {
JToolBarHelper::save2copy('group.save2copy');
}
if (empty($this->item->id)) {
JToolBarHelper::cancel('group.cancel');
} else {
JToolBarHelper::cancel('group.cancel', 'JTOOLBAR_CLOSE');
}
JToolBarHelper::divider();
JToolBarHelper::help('JHELP_USERS_GROUPS_EDIT');
}