예제 #1
0
 protected function addToolbar()
 {
     JFactory::getApplication()->input->set('hidemainmenu', true);
     $bar = JToolBar::getInstance();
     $doc = JFactory::getDocument();
     $isNew = $this->item->id == 0;
     JToolBarHelper::title(JText::sprintf('COM_TZ_PORTFOLIO_PLUS_GROUP_FIELDS_MANAGER_TASK', JText::_($isNew ? 'COM_TZ_PORTFOLIO_PLUS_PAGE_ADD_GROUP_FIELD' : 'COM_TZ_PORTFOLIO_PLUS_PAGE_EDIT_GROUP_FIELD')), 'folder-plus-2');
     JToolBarHelper::apply('group.apply');
     JToolBarHelper::save('group.save');
     JToolBarHelper::save2new('group.save2new');
     JToolBarHelper::cancel('group.cancel', JText::_('JTOOLBAR_CLOSE'));
     JToolBarHelper::divider();
     JToolBarHelper::help('JHELP_CONTENT_ARTICLE_MANAGER', false, 'http://wiki.templaza.com/TZ_Portfolio_Plus_v3:Administration#How_to_Add_or_Edit');
     // If the joomla is version 3.0
     if (COM_TZ_PORTFOLIO_PLUS_JVERSION_COMPARE) {
         $doc->addStyleSheet(JURI::base(true) . '/components/com_tz_portfolio_plus/fonts/font-awesome-4.5.0/css/font-awesome.min.css');
     }
     $doc->addStyleSheet(JURI::base(true) . '/components/com_tz_portfolio_plus/css/style.min.css');
     // Special HTML workaround to get send popup working
     $docClass = ' class="btn btn-small"';
     $youtubeIcon = '<i class="tz-icon-youtube tz-icon-14"></i>&nbsp;';
     $wikiIcon = '<i class="tz-icon-wikipedia tz-icon-14"></i>&nbsp;';
     $youtubeTitle = JText::_('COM_TZ_PORTFOLIO_PLUS_VIDEO_TUTORIALS');
     $wikiTitle = JText::_('COM_TZ_PORTFOLIO_PLUS_WIKIPEDIA_TUTORIALS');
     $videoTutorial = '<a' . $docClass . ' onclick="Joomla.popupWindow(\'http://www.youtube.com/channel/UCykS6SX6L2GOI-n3IOPfTVQ/videos\', \'' . $youtubeTitle . '\', 800, 500, 1)"' . ' href="#">' . $youtubeIcon . $youtubeTitle . '</a>';
     $wikiTutorial = '<a' . $docClass . ' onclick="Joomla.popupWindow(\'http://wiki.templaza.com/Main_Page\', \'' . $wikiTitle . '\', 800, 500, 1)"' . ' href="#">' . $wikiIcon . $wikiTitle . '</a>';
     $bar->appendButton('Custom', $videoTutorial, 'youtube');
     $bar->appendButton('Custom', $wikiTutorial, 'wikipedia');
 }
예제 #2
0
 /**
  * Add the page title and toolbar.
  *
  * @since	1.6
  */
 protected function addToolbar()
 {
     require_once JPATH_COMPONENT . '/helpers/languages.php';
     JRequest::setVar('hidemainmenu', 1);
     $isNew = empty($this->item->lang_id);
     $canDo = LanguagesHelper::getActions();
     JToolBarHelper::title(JText::_($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')) {
         JToolBarHelper::save('language.save');
     }
     //If an existing item, allow to Apply and Save.
     if (!$isNew && $canDo->get('core.edit')) {
         JToolBarHelper::apply('language.apply');
         JToolBarHelper::save('language.save');
     }
     // If an existing item, can save to a copy only if we have create rights.
     if ($canDo->get('core.create')) {
         JToolBarHelper::save2new('language.save2new');
     }
     if ($isNew) {
         JToolBarHelper::cancel('language.cancel');
     } else {
         JToolBarHelper::cancel('language.cancel', 'JTOOLBAR_CLOSE');
     }
     JToolBarHelper::divider();
     JToolBarHelper::help('JHELP_EXTENSIONS_LANGUAGE_MANAGER_EDIT');
 }
예제 #3
0
파일: view.html.php 프로젝트: ngxuanmui/hp3
 /**
  * Add the page title and toolbar.
  *
  * @since	1.6
  */
 protected function addToolbar()
 {
     JRequest::setVar('hidemainmenu', true);
     $user = JFactory::getUser();
     $userId = $user->get('id');
     $isNew = $this->item->id == 0;
     $checkedOut = !($this->item->checked_out == 0 || $this->item->checked_out == $userId);
     $canDo = Jnt_HanhphucHelper::getActions($this->state->get('filter.category_id'));
     JToolBarHelper::title($isNew ? JText::_('User Content: Edit') : JText::_('User Content: New'), 'article.png');
     // If not checked out, can save the item.
     if (!$checkedOut && ($canDo->get('core.edit') || count($user->getAuthorisedCategories('com_je_content', 'core.create')) > 0)) {
         JToolBarHelper::apply('article.apply');
         JToolBarHelper::save('article.save');
         if ($canDo->get('core.create')) {
             JToolBarHelper::save2new('article.save2new');
         }
     }
     // If an existing item, can save to a copy.
     if (!$isNew && $canDo->get('core.create')) {
         JToolBarHelper::save2copy('article.save2copy');
     }
     if (empty($this->item->id)) {
         JToolBarHelper::cancel('article.cancel');
     } else {
         JToolBarHelper::cancel('article.cancel', 'JTOOLBAR_CLOSE');
     }
 }
예제 #4
0
 /**
  * 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 = MenusHelper::getActions($this->state->get('filter.parent_id'));
     JToolBarHelper::title(JText::_($isNew ? 'COM_MENUS_VIEW_NEW_ITEM_TITLE' : 'COM_MENUS_VIEW_EDIT_ITEM_TITLE'), 'menu-add');
     // 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')) {
             JToolBarHelper::apply('adminitem.apply');
         }
         JToolBarHelper::save('adminitem.save');
     }
     // If not checked out, can save the item.
     if (!$isNew && !$checkedOut && $canDo->get('core.edit')) {
         JToolBarHelper::apply('adminitem.apply');
         JToolBarHelper::save('adminitem.save');
     }
     // If the user can create new items, allow them to see Save & New
     if ($canDo->get('core.create')) {
         JToolBarHelper::save2new('adminitem.save2new');
     }
     // If an existing item, can save to a copy only if we have create rights.
     if (!$isNew && $canDo->get('core.create')) {
         JToolBarHelper::save2copy('adminitem.save2copy');
     }
     if ($isNew) {
         JToolBarHelper::cancel('adminitem.cancel');
     } else {
         JToolBarHelper::cancel('adminitem.cancel', 'JTOOLBAR_CLOSE');
     }
 }
예제 #5
0
파일: view.html.php 프로젝트: Tommar/remate
 /**
  * Setting the toolbar
  */
 protected function addToolbar()
 {
     JRequest::setVar('hidemainmenu', true);
     $user = JFactory::getUser();
     $userId = $user->get('id');
     $isNew = $this->item->id == 0;
     $checkedOut = !($this->item->checked_out == 0 || $this->item->checked_out == $userId);
     JToolBarHelper::title($isNew ? JText::_('COM_BT_PORTFOLIO_NEW_CATEGORY') : JText::_('COM_BT_PORTFOLIO_EDIT_CATEGORY'), 'category-add.png');
     if ($isNew) {
         JToolBarHelper::apply('category.apply');
         JToolBarHelper::save('category.save');
         JToolBarHelper::save2new('category.save2new');
         JToolBarHelper::save2copy('category.save2copy');
         JToolBarHelper::cancel('category.cancel');
     } else {
         // Can't save the record if it's checked out.
         if (!$checkedOut) {
             JToolBarHelper::apply('category.apply');
             JToolBarHelper::save('category.save');
             JToolBarHelper::save2new('category.save2new');
         }
         JToolBarHelper::save2copy('category.save2copy');
         JToolBarHelper::cancel('category.cancel', 'JTOOLBAR_CLOSE');
     }
 }
예제 #6
0
 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>', 'fss_prods');
     JToolBarHelper::custom('translate', 'translate', 'translate', 'Translate', false);
     JToolBarHelper::spacer();
     JToolBarHelper::apply();
     JToolBarHelper::save();
     JToolBarHelper::save2new();
     if ($isNew) {
         JToolBarHelper::cancel();
     } else {
         // for existing items the button is renamed `close`
         JToolBarHelper::cancel('cancel', 'Close');
     }
     FSSAdminHelper::DoSubToolbar();
     $this->prod = $prod;
     $path = JPATH_SITE . DS . 'images' . DS . 'fss' . 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->lists = $lists;
     parent::display($tpl);
 }
예제 #7
0
 /**
  * Add the page title and toolbar.
  */
 protected function addToolbar()
 {
     JRequest::setVar('hidemainmenu', true);
     $doc = JFactory::getDocument();
     $doc->addStyleDeclaration('.icon-48-babioon {background-image: url(../media/babioon/images/icon-48-babioon.png);}');
     $user = JFactory::getUser();
     $userId = $user->get('id');
     $isNew = $this->item->id == 0;
     $checkedOut = !($this->item->checked_out == 0 || $this->item->checked_out == $userId);
     $canDo = BabioonDownloadHelpers::getActions();
     JToolBarHelper::title($isNew ? JText::_('COM_BABIOONDOWNLOAD_DOWNLOAD_NEW') : JText::_('COM_BABIOONDOWNLOAD_DOWNLOAD_EDIT'), 'babioon.png');
     // If not checked out, can save the item.
     if (!$checkedOut && ($canDo->get('core.edit') || count($user->getAuthorisedCategories('com_babioondownload', 'core.create')) > 0)) {
         JToolBarHelper::apply('download.apply');
         JToolBarHelper::save('download.save');
         if ($canDo->get('core.create')) {
             JToolBarHelper::save2new('download.save2new');
         }
     }
     // If an existing item, can save to a copy.
     if (!$isNew && $canDo->get('core.create')) {
         JToolBarHelper::save2copy('download.save2copy');
     }
     if (empty($this->item->id)) {
         JToolBarHelper::cancel('download.cancel');
     } else {
         JToolBarHelper::cancel('download.cancel', 'JTOOLBAR_CLOSE');
     }
 }
예제 #8
0
 /**
  * Add the page title and toolbar.
  *
  */
 protected function addToolbar()
 {
     $jinput = JFactory::getApplication()->input;
     $jinput->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 = JEMHelperBackend::getActions();
     JToolBarHelper::title($isNew ? JText::_('COM_JEM_ADD_VENUE') : JText::_('COM_JEM_EDIT_VENUE'), 'venuesedit');
     // If not checked out, can save the item.
     if (!$checkedOut && ($canDo->get('core.edit') || $canDo->get('core.create'))) {
         JToolBarHelper::apply('venue.apply');
         JToolBarHelper::save('venue.save');
     }
     if (!$checkedOut && $canDo->get('core.create')) {
         JToolBarHelper::save2new('venue.save2new');
     }
     // If an existing item, can save to a copy.
     if (!$isNew && $canDo->get('core.create')) {
         JToolBarHelper::save2copy('venue.save2copy');
     }
     if (empty($this->item->id)) {
         JToolBarHelper::cancel('venue.cancel');
     } else {
         JToolBarHelper::cancel('venue.cancel', 'JTOOLBAR_CLOSE');
     }
     JToolBarHelper::divider();
     JToolBarHelper::help('editvenues', true);
 }
예제 #9
0
 /**
  * Add the page title and toolbar.
  *
  * 
  */
 protected function addToolbar()
 {
     require_once JPATH_COMPONENT . '/helpers/jdownloadshelper.php';
     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 = JDownloadsHelper::getActions();
     $document = JFactory::getDocument();
     $document->addStyleSheet('components/com_jdownloads/assets/css/style.css');
     $title = $isNew ? JText::_('COM_JDOWNLOADS_LICEDIT_ADD') : JText::_('COM_JDOWNLOADS_LICEDIT_EDIT');
     JToolBarHelper::title(JText::_('COM_JDOWNLOADS') . ': ' . $title, 'jdlicenses');
     // If not checked out, can save the item.
     if (!$checkedOut && ($canDo->get('core.edit') || $canDo->get('core.create'))) {
         JToolBarHelper::apply('license.apply');
         JToolBarHelper::save('license.save');
     }
     if (!$checkedOut && $canDo->get('core.create')) {
         JToolBarHelper::save2new('license.save2new');
     }
     // If an existing item, can save to a copy.
     if (!$isNew && $canDo->get('core.create')) {
         JToolBarHelper::save2copy('license.save2copy');
     }
     if (empty($this->item->id)) {
         JToolBarHelper::cancel('license.cancel');
     } else {
         JToolBarHelper::cancel('license.cancel', 'JTOOLBAR_CLOSE');
     }
     JToolBarHelper::divider();
     JToolBarHelper::help('help.license', true);
 }
예제 #10
0
 protected function addToolBar()
 {
     $app = JFactory::getApplication();
     $app->input->set('hidemainmenu', true);
     $isNew = $this->item->id == 0;
     $user = JFactory::getUser();
     $userId = $user->id;
     $checkedOut = !($this->item->checked_out == 0 || $this->item->checked_out == $userId);
     JToolBarHelper::title(JText::_('COM_JUDOWNLOAD_PAGE_' . ($checkedOut ? 'VIEW_CRITERIAGROUP' : ($isNew ? 'ADD_CRITERIAGROUP' : 'EDIT_CRITERIAGROUP'))), 'criteriagroup-add');
     if ($isNew && $user->authorise('core.create', 'com_judownload')) {
         JToolBarHelper::apply('criteriagroup.apply');
         JToolBarHelper::save('criteriagroup.save');
         JToolBarHelper::save2new('criteriagroup.save2new');
         JToolBarHelper::cancel('criteriagroup.cancel');
     } else {
         if (!$checkedOut) {
             if ($this->canDo->get('core.edit') || $this->canDo->get('core.edit.own') && $this->item->created_by == $userId) {
                 JToolBarHelper::apply('criteriagroup.apply');
                 JToolBarHelper::save('criteriagroup.save');
                 if ($this->canDo->get('core.create')) {
                     JToolBarHelper::save2new('criteriagroup.save2new');
                 }
             }
         }
         JToolBarHelper::cancel('criteriagroup.cancel', 'JTOOLBAR_CLOSE');
     }
     JToolBarHelper::divider();
     $bar = JToolBar::getInstance('toolbar');
     $bar->addButtonPath(JPATH_ADMINISTRATOR . "/components/com_judownload/helpers/button");
     $bar->appendButton('JUHelp', 'help', JText::_('JTOOLBAR_HELP'));
 }
예제 #11
0
 /**
  * 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 = J2XMLHelper::getActions();
     $doc = JFactory::getDocument();
     $icon_48_websites = " .icon-48-websites {background:url(../media/com_j2xml/images/icon-48-websites.png) no-repeat; }";
     $doc->addStyleDeclaration($icon_48_websites);
     JToolBarHelper::title($isNew ? JText::_('COM_J2XML_MANAGER_WEBSITE_NEW') : JText::_('COM_J2XML_MANAGER_WEBSITE_EDIT'), 'websites.png');
     // If not checked out, can save the item.
     if (!$checkedOut && ($canDo->get('core.edit') || $canDo->get('core.create'))) {
         JToolBarHelper::apply('website.apply');
         JToolBarHelper::save('website.save');
     }
     if (!$checkedOut && $canDo->get('core.create')) {
         JToolBarHelper::save2new('website.save2new');
     }
     // If an existing item, can save to a copy.
     if (!$isNew && $canDo->get('core.create')) {
         JToolBarHelper::save2copy('website.save2copy');
     }
     if (empty($this->item->id)) {
         JToolBarHelper::cancel('website.cancel');
     } else {
         JToolBarHelper::cancel('website.cancel', 'JTOOLBAR_CLOSE');
     }
 }
예제 #12
0
 /**
  * Add the page title and toolbar.
  *
  * @since	1.6
  */
 protected function addToolbar()
 {
     JRequest::setVar('hidemainmenu', true);
     $user = JFactory::getUser();
     $userId = $user->get('id');
     $isNew = $this->item->id == 0;
     $checkedOut = !($this->item->checked_out == 0 || $this->item->checked_out == $userId);
     $canDo = RentalHelper::getActions($this->state->get('filter.category_id'));
     JToolBarHelper::title($isNew ? JText::_('COM_RENTAL_MANAGER_APARTMENT_NEW') : JText::_('COM_RENTAL_MANAGER_APARTMENT_EDIT'), '#xs#.png');
     // If not checked out, can save the item.
     if (!$checkedOut && ($canDo->get('core.edit') || count($user->getAuthorisedCategories('com_rental', 'core.create')) > 0)) {
         JToolBarHelper::apply('apartment.apply');
         JToolBarHelper::save('apartment.save');
         if ($canDo->get('core.create')) {
             JToolBarHelper::save2new('apartment.save2new');
         }
     }
     // If an existing item, can save to a copy.
     if (!$isNew && $canDo->get('core.create')) {
         JToolBarHelper::save2copy('apartment.save2copy');
     }
     if (empty($this->item->id)) {
         JToolBarHelper::cancel('apartment.cancel');
     } else {
         JToolBarHelper::cancel('apartment.cancel', 'JTOOLBAR_CLOSE');
     }
 }
예제 #13
0
 /**
  * Mapbox view display method
  * @return void
  **/
 function display($tpl = null)
 {
     $input = JFactory::getApplication()->input;
     $layout = $input->get->get('layout', 'list', 'string');
     $this->setLayout($layout);
     switch ($layout) {
         case "list":
             MapboxHelper::addSubmenu($input->get('view', 'mapbox'));
             JToolBarHelper::title(JText::_('COM_MAPBOX_VIEW_MAPBOX_LIST_TITLE'), 'generic.png');
             JToolBarHelper::addNew('mapbox.add', 'JTOOLBAR_NEW');
             JToolBarHelper::editList('mapbox.edit', 'JTOOLBAR_EDIT', true);
             JToolBarHelper::deleteList(JText::_('COM_MAPBOX_MSG_DELETE_CONFIRM'), 'mapbox.delete', 'JTOOLBAR_DELETE', true);
             JToolBarHelper::preferences('com_mapbox', '500');
             // GET DATA FROM THE MODEL
             $this->filter = $this->get('State');
             $this->items = $this->get('List');
             $this->page = $this->get('Pagination');
             break;
         default:
             $input->set('hidemainmenu', 1);
             JToolBarHelper::title(JText::_('COM_MAPBOX_VIEW_MAPBOX_EDIT_TITLE'), 'generic.png');
             JToolBarHelper::apply('mapbox.apply');
             JToolBarHelper::save('mapbox.save');
             JToolBarHelper::save2new('mapbox.save2new');
             JToolBarHelper::cancel('mapbox.cancel');
             $this->form = $this->get('Form');
             break;
     }
     parent::display($tpl);
 }
예제 #14
0
 /**
  * Setting the toolbar
  */
 protected function addToolBar()
 {
     JRequest::setVar('hidemainmenu', true);
     $user = JFactory::getUser();
     $userId = $user->get('id');
     $canDo = MaintHelper::getActions();
     $isNew = false == isset($this->order) || $this->order->id == 0;
     $this->canDeliver = $canDo->get('core.deliver');
     JToolBarHelper::title($isNew ? JText::_('COM_MAINT_ADD_APPLICATION') : JText::_('COM_MAINT_EDIT_APPLICATION'));
     if ($isNew) {
         // For new records, check the create permission.
         if ($canDo->get('core.create')) {
             JToolBarHelper::apply('maint.apply', 'JTOOLBAR_APPLY');
             JToolBarHelper::save('maint.save', 'JTOOLBAR_SAVE');
             JToolBarHelper::save2new('maint.save2new');
         }
     } else {
         if ($canDo->get('core.edit')) {
             JToolBarHelper::apply('maint.apply', 'JTOOLBAR_APPLY');
             JToolBarHelper::save('maint.save', 'JTOOLBAR_SAVE');
             // if we can return to make a new one.
             if ($canDo->get('core.create')) {
                 JToolBarHelper::save2new('maint.save2new');
             }
         }
         $bar = JToolBar::getInstance('toolbar');
         $bar->addButtonPath(JPATH_COMPONENT . '/button/');
         $bar->appendButton('Print', 'COM_MAINT_PRINT', 'index.php?option=com_maint&task=maints.pprint&id=' . $this->order->id);
     }
     JToolBarHelper::cancel('maint.cancel', 'JTOOLBAR_CANCEL');
 }
예제 #15
0
 function setToolbar()
 {
     switch ($this->_task) {
         default:
             JToolBarHelper::title(JText::_('Tags Manager'));
             JToolBarHelper::editList();
             JToolBarHelper::divider();
             JToolBarHelper::publishList();
             JToolBarHelper::unpublishList();
             JToolBarHelper::divider();
             JToolBarHelper::deleteList(JText::_('COM_TZ_PINBOARD_QUESTION_DELETE'));
             JToolBarHelper::preferences('com_tz_pinboard');
             break;
         case 'add':
         case 'new':
             JRequest::setVar('hidemainmenu', true);
             JToolBarHelper::title(JText::_('Tags Manager: <small><small>' . JText::_(ucfirst($this->_task)) . '</small></small>'));
             JToolBarHelper::save2new();
             JToolBarHelper::save();
             JToolBarHelper::apply();
             JToolBarHelper::cancel();
             break;
         case 'edit':
             JRequest::setVar('hidemainmenu', true);
             JToolBarHelper::title(JText::_('Tags Manager: <small><small>' . JText::_(ucfirst(JRequest::getCmd('task'))) . '</small></small>'));
             JToolBarHelper::save();
             JToolBarHelper::apply();
             JToolBarHelper::cancel('cancel', JText::_('JTOOLBAR_CLOSE'));
             break;
     }
     $state = array('P' => JText::_('JPUBLISHED'), 'U' => JText::_('JUNPUBLISHED'));
     JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_PUBLISHED'), 'filter_state', JHtml::_('select.options', $state, 'value', 'text', $this->state->filter_state));
 }
예제 #16
0
 protected function addToolbar()
 {
     $jinput = JFactory::getApplication()->input;
     $jinput->set('hidemainmenu', true);
     $user = JFactory::getUser();
     $userId = $user->get('id');
     $isNew = $this->item->id == 0;
     $canDo = Bt_SocialconnectAdminHelper::getActions($this->state->get('filter.category_id'), $this->item->id);
     JToolBarHelper::title($isNew ? JText::_('COM_BT_SOCIALCONNECT_CONNECTION_NEW') : JText::_('COM_BT_SOCIALCONNECT_CONNECTION_EDIT'), 'socialconnect-add.png');
     if ($isNew && count($user->getAuthorisedCategories('com_bt_socialconnect', 'core.create')) > 0) {
         JToolBarHelper::apply('connection.apply');
         JToolBarHelper::save('connection.save');
         JToolBarHelper::save2new('connection.save2new');
         JToolBarHelper::cancel('connection.cancel');
     } else {
         if ($canDo->get('core.edit') || $canDo->get('core.edit.own') && $this->item->created_by == $userId) {
             JToolBarHelper::apply('connection.apply');
             JToolBarHelper::save('connection.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::save2new('connection.save2new');
             }
         }
         // If checked out, we can still save
         JToolBarHelper::cancel('connection.cancel', 'JTOOLBAR_CLOSE');
     }
     JToolBarHelper::divider();
 }
예제 #17
0
 /**
  * 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');
         JToolBarHelper::save('newsfeed.save');
     }
     if (!$checkedOut && count($user->getAuthorisedCategories('com_newsfeeds', 'core.create')) > 0) {
         JToolBarHelper::save2new('newsfeed.save2new');
     }
     // If an existing item, can save to a copy.
     if (!$isNew && $canDo->get('core.create')) {
         JToolBarHelper::save2copy('newsfeed.save2copy');
     }
     if (empty($this->item->id)) {
         JToolBarHelper::cancel('newsfeed.cancel');
     } else {
         JToolBarHelper::cancel('newsfeed.cancel', 'JTOOLBAR_CLOSE');
     }
     JToolBarHelper::divider();
     JToolBarHelper::help('JHELP_COMPONENTS_NEWSFEEDS_FEEDS_EDIT');
 }
예제 #18
0
 /**
  * Add the page title and toolbar.
  *
  * @since	1.6
  */
 protected function addToolbar()
 {
     JRequest::setVar('hidemainmenu', true);
     $user = JFactory::getUser();
     $userId = $user->get('id');
     $isNew = $this->item->id == 0;
     $checkedOut = !($this->item->checked_out == 0 || $this->item->checked_out == $userId);
     // Since we don't track these assets at the item level, use the category id.
     $canDo = BannersHelper::getActions($this->item->catid, 0);
     JToolBarHelper::title($isNew ? JText::_('COM_BANNERS_MANAGER_BANNER_NEW') : JText::_('COM_BANNERS_MANAGER_BANNER_EDIT'), 'banners.png');
     // If not checked out, can save the item.
     if (!$checkedOut && ($canDo->get('core.edit') || count($user->getAuthorisedCategories('com_banners', 'core.create')) > 0)) {
         JToolBarHelper::apply('banner.apply');
         JToolBarHelper::save('banner.save');
         if ($canDo->get('core.create')) {
             JToolBarHelper::save2new('banner.save2new');
         }
     }
     // If an existing item, can save to a copy.
     if (!$isNew && $canDo->get('core.create')) {
         JToolBarHelper::save2copy('banner.save2copy');
     }
     if (empty($this->item->id)) {
         JToolBarHelper::cancel('banner.cancel');
     } else {
         JToolBarHelper::cancel('banner.cancel', 'JTOOLBAR_CLOSE');
     }
     JToolBarHelper::divider();
     JToolBarHelper::help('JHELP_COMPONENTS_BANNERS_BANNERS_EDIT');
 }
예제 #19
0
 /**
  * Add the page title and toolbar.
  *
  * @since	1.6
  */
 protected function addEditEntityToolbar()
 {
     $user = JFactory::getUser();
     $userId = $user->get('id');
     $isNew = $this->record->id == 0;
     $checkedOut = !($this->record->checked_out == 0 || $this->record->checked_out == $userId);
     $toolbarHelperTitle = $isNew ? 'COM_JMAP_DATASETS_NEW' : 'COM_JMAP_DATASETS_EDIT';
     $doc = JFactory::getDocument();
     $doc->addStyleDeclaration('.icon-48-jmap{background-image:url("components/com_jmap/images/icon-48-datasets.png")}');
     JToolBarHelper::title(JText::_($toolbarHelperTitle), 'jmap');
     if ($isNew) {
         // For new records, check the create permission.
         if ($isNew && $user->authorise('core.create', 'com_jmap')) {
             JToolBarHelper::apply('datasets.applyEntity', 'JAPPLY');
             JToolBarHelper::save('datasets.saveEntity', 'JSAVE');
             JToolBarHelper::save2new('datasets.saveEntity2New');
         }
     } 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 ($user->authorise('core.edit', 'com_jmap')) {
                 JToolBarHelper::apply('datasets.applyEntity', 'JAPPLY');
                 JToolBarHelper::save('datasets.saveEntity', 'JSAVE');
                 JToolBarHelper::save2new('datasets.saveEntity2New');
             }
         }
     }
     JToolBarHelper::custom('datasets.cancelEntity', 'cancel', 'cancel', 'JCANCEL', false);
 }
예제 #20
0
 /**
  * Add the page title and toolbar.
  *
  * @since	1.6
  */
 protected function addToolbar()
 {
     JRequest::setVar('hidemainmenu', true);
     $user = JFactory::getUser();
     $isNew = $this->item->id == 0;
     $canDo = RedirectHelper::getActions();
     JToolBarHelper::title(JText::_('COM_REDIRECT_MANAGER_LINK'), 'redirect');
     // If not checked out, can save the item.
     if ($canDo->get('core.edit')) {
         JToolBarHelper::apply('link.apply');
         JToolBarHelper::save('link.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')) {
         JToolBarHelper::save2new('link.save2new');
     }
     if (empty($this->item->id)) {
         JToolBarHelper::cancel('link.cancel');
     } else {
         JToolBarHelper::cancel('link.cancel', 'JTOOLBAR_CLOSE');
     }
     JToolBarHelper::help('JHELP_COMPONENTS_REDIRECT_MANAGER_EDIT');
 }
예제 #21
0
 /**
  * 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');
 }
예제 #22
0
 /**
  * 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');
     }
 }
예제 #23
0
파일: view.html.php 프로젝트: A-Bush/pprod
 /**
  * Sets the toolbar.
  */
 protected function addToolBar()
 {
     $canDo = SimpleCustomRouterHelper::getActions();
     $isNew = $this->item->id == 0;
     if ($isNew) {
         JToolBarHelper::title(JText::_('COM_SIMPLECUSTOMROUTER_MANAGER_ROUTE_NEW'));
         if ($canDo->get('core.create')) {
             JToolBarHelper::apply('route.apply');
             JToolBarHelper::save('route.save');
             JToolBarHelper::save2new('route.save2new');
         }
         JToolBarHelper::cancel('route.cancel');
     } else {
         JToolBarHelper::title(JText::_('COM_SIMPLECUSTOMROUTER_MANAGER_ROUTE_EDIT'));
         if ($canDo->get('core.edit')) {
             JToolBarHelper::apply('route.apply');
             JToolBarHelper::save('route.save');
             if ($canDo->get('core.create')) {
                 JToolBarHelper::save2new('route.save2new');
             }
         }
         if ($canDo->get('core.create')) {
             JToolBarHelper::save2copy('route.save2copy');
         }
         JToolBarHelper::cancel('route.cancel', 'JTOOLBAR_CLOSE');
     }
 }
예제 #24
0
 /**
  * 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');
 }
예제 #25
0
파일: view.html.php 프로젝트: Tommar/remate
 /**
  * Setting the toolbar
  */
 protected function addToolbar()
 {
     if (Bt_portfolioLegacyHelper::isLegacy()) {
         JRequest::setVar('hidemainmenu', true);
     } else {
         JRequest::setVar('hidemainmenu', false);
     }
     $user = JFactory::getUser();
     $userId = $user->get('id');
     $isNew = $this->item->id == 0;
     $checkedOut = !($this->item->checked_out == 0 || $this->item->checked_out == $userId);
     JToolBarHelper::title($isNew ? JText::_('COM_BT_PORTFOLIO_NEW_EXTRAFIELD') : JText::_('COM_BT_PORTFOLIO_EDIT_EXTRAFIELD'), 'article-add.png');
     if ($isNew) {
         JToolBarHelper::apply('extrafield.apply');
         JToolBarHelper::save('extrafield.save');
         JToolBarHelper::save2new('extrafield.save2new');
         JToolBarHelper::cancel('extrafield.cancel');
     } else {
         // Can't save the record if it's checked out.
         if (!$checkedOut) {
             JToolBarHelper::apply('extrafield.apply');
             JToolBarHelper::save('extrafield.save');
             JToolBarHelper::save2new('extrafield.save2new');
         }
         JToolBarHelper::cancel('extrafield.cancel', 'JTOOLBAR_CLOSE');
     }
 }
예제 #26
0
 /**
  * Add the page title and toolbar.
  *
  * @since	1.6
  */
 protected function addToolbar()
 {
     JRequest::setVar('hidemainmenu', true);
     $user = JFactory::getUser();
     $isNew = $this->item->id == 0;
     $canDo = MenusHelper::getActions($this->state->get('filter.parent_id'));
     JToolBarHelper::title(JText::_($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')) {
             JToolBarHelper::apply('menu.apply');
         }
         JToolBarHelper::save('menu.save');
     }
     // If user can edit, can save the item.
     if (!$isNew && $canDo->get('core.edit')) {
         JToolBarHelper::apply('menu.apply');
         JToolBarHelper::save('menu.save');
     }
     // If the user can create new items, allow them to see Save & New
     if ($canDo->get('core.create')) {
         JToolBarHelper::save2new('menu.save2new');
     }
     if ($isNew) {
         JToolBarHelper::cancel('menu.cancel');
     } else {
         JToolBarHelper::cancel('menu.cancel', 'JTOOLBAR_CLOSE');
     }
     JToolBarHelper::divider();
     JToolBarHelper::help('JHELP_MENUS_MENU_MANAGER_EDIT');
 }
예제 #27
0
 function display($tpl = null)
 {
     require_once JPATH_COMPONENT_ADMINISTRATOR . '/views/common.php';
     //        layout start
     if ($layoutName == 'formexperience') {
         // jobtypes
         if (isset($_GET['cid'][0])) {
             $c_id = $_GET['cid'][0];
         } else {
             $c_id = '';
         }
         if ($c_id == '') {
             $cids = JRequest::getVar('cid', array(0), 'post', 'array');
             $c_id = $cids[0];
         }
         if (is_numeric($c_id) == true and $c_id != 0) {
             $application = $this->getJSModel('experience')->getJobExperiencebyId($c_id);
         }
         if (isset($application->id)) {
             $isNew = false;
         }
         $text = $isNew ? JText::_('ADD') : JText::_('EDIT');
         JToolBarHelper::title(JText::_('JS_JOB_EXPERIENCE') . ': <small><small>[ ' . $text . ' ]</small></small>');
         JToolBarHelper::apply('experience.savejobexperiencesave', 'SAVE');
         JToolBarHelper::save2new('experience.savejobexperienceandnew');
         JToolBarHelper::save('experience.savejobexperience');
         if ($isNew) {
             JToolBarHelper::cancel('experience.cancel');
         } else {
             JToolBarHelper::cancel('experience.cancel', 'Close');
         }
     } elseif ($layoutName == 'experience') {
         //job types
         JToolBarHelper::title(JText::_('JS_JOB_EXPERIENCE'));
         JToolBarHelper::addNew('experience.editjobexperience');
         JToolBarHelper::editList('experience.editjobexperience');
         JToolBarHelper::deleteList(JText::_('JS_ARE_YOU_SURE'), 'experience.remove');
         $result = $this->getJSModel('experience')->getAllExperience($limitstart, $limit);
         $items = $result[0];
         $total = $result[1];
         if ($total <= $limitstart) {
             $limitstart = 0;
         }
         $pagination = new JPagination($total, $limitstart, $limit);
         $this->assignRef('pagination', $pagination);
     }
     //        layout end
     $this->assignRef('config', $config);
     $this->assignRef('application', $application);
     $this->assignRef('items', $items);
     $this->assignRef('theme', $theme);
     $this->assignRef('option', $option);
     $this->assignRef('uid', $uid);
     $this->assignRef('msg', $msg);
     $this->assignRef('isjobsharing', $_client_auth_key);
     parent::display($tpl);
 }
예제 #28
0
 protected function addToolbar()
 {
     JToolBarHelper::title('JDeveloper Table');
     JToolBarHelper::apply('table.apply');
     JToolBarHelper::save('table.save');
     JToolBarHelper::save2new('table.save2new');
     JToolBarHelper::save2copy('table.save2copy');
     JToolBarHelper::cancel('table.cancel', 'JTOOLBAR_CANCEL');
 }
예제 #29
0
 /**
  * display method of Cp view
  * @return void
  **/
 function display($tpl = null)
 {
     // Initialiase variables.
     $this->form = $this->get('Form');
     $this->item = $this->get('Item');
     $this->state = $this->get('State');
     // Check for errors.
     if (count($errors = $this->get('Errors'))) {
         JError::raiseError(500, implode("\n", $errors));
         return false;
     }
     JRequest::setVar('hidemainmenu', true);
     $user = JFactory::getUser();
     $isNew = empty($this->item->product_id);
     $document = JFactory::getDocument();
     if (JRequest::getVar('tmpl', '') != 'component') {
         $document->addScript(JURI::base(true) . '/components/com_cp/assets/js/jquery-1.10.1.min.js');
         $document->addScriptDeclaration('jQuery.noConflict();');
         $document->addScript(JURI::base(true) . '/components/com_cp/assets/js/jquery-ui-1.10.3.custom.min.js');
         $document->addScript(JURI::base(true) . '/components/com_cp/assets/js/scripts.js');
         $document->addStyleSheet(JURI::base(true) . '/components/com_cp/assets/css/style.css');
         $document->addStyleSheet(JURI::base(true) . '/components/com_cp/assets/css/smoothness/jquery-ui-1.8.21.custom.css');
         $document->addStyleDeclaration('body { min-width: 1170px; }');
     }
     // Create the form
     JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields');
     $text = $isNew ? JText::_('COM_CP_NEW') : JText::_('COM_CP_EDIT');
     JToolBarHelper::title($text . ' ' . JText::_('COM_CP_PRODUCT_PAGE_TITLE'));
     if ($isNew && $user->authorise('core.create', 'com_cp')) {
         JToolBarHelper::apply('cpproducts.apply');
         JToolBarHelper::save('cpproducts.save');
         JToolBarHelper::save2new('cpproducts.save2new');
         JToolBarHelper::cancel('cpproducts.cancel');
     } else {
         if ($user->authorise('core.edit', 'com_cp')) {
             JToolBarHelper::apply('cpproducts.apply');
             JToolBarHelper::save('cpproducts.save');
             if ($user->authorise('core.edit', 'com_cp')) {
                 JToolBarHelper::save2new('cpproducts.save2new');
             }
             JToolBarHelper::cancel('cpproducts.cancel', 'COM_CP_CLOSE');
         }
     }
     $helper = new CPHelper();
     if ($isNew) {
         $countFiles = 0;
     } else {
         $countFiles = count($this->item->media);
     }
     // Initialize media files script
     $document->addScriptDeclaration('var mediaCount = ' . $countFiles . '; var delText = "' . JText::_('COM_CP_DELETE') . '"; var siteURL = "' . JURI::root() . '";');
     $params = JComponentHelper::getParams('com_cp');
     $this->assignRef('params', $params);
     $this->item->cities = $helper->listCities($this->item->country_code, $this->item->city, 'jform[city]', 'jform_city');
     parent::display($tpl);
 }
예제 #30
0
 protected function addToolbar()
 {
     JRequest::setVar('hidemainmenu', true);
     JToolBarHelper::title(JText::_('JOOMDOC_CUSTOM_FIELD'), 'field');
     JToolBarHelper::apply('field.apply');
     JToolBarHelper::save('field.save');
     JToolBarHelper::save2new('field.save2new');
     JToolBarHelper::save2copy('field.save2copy');
     JToolBarHelper::cancel('field.cancel');
 }