/** * Add the page title and toolbar. * * @return void * * @since 1.6 */ protected function addToolBar() { $input = JFactory::getApplication()->input; // Hide Joomla Administrator Main menu $input->set('hidemainmenu', true); $isNew = $this->item->id == 0; if ($isNew) { $title = JText::_('COM_ISSNREGISTRY_PUBLISHER_NEW'); } else { $title = JText::_('COM_ISSNREGISTRY_PUBLISHER_EDIT'); $title .= ' : ' . $this->item->official_name; } JToolBarHelper::title($title, 'publisher'); JToolbarHelper::apply('publisher.apply'); if (!$isNew) { // Add custom button for sending a message $toolbar = JToolBar::getInstance('toolbar'); $layout = new JLayoutFile('joomla.toolbar.popup'); // Render the popup button $dhtml = $layout->render(array('name' => 'generate-message', 'doTask' => '', 'text' => JText::_('COM_ISSNREGISTRY_PUBLISHER_BUTTON_SEND_MESSAGE'), 'class' => 'icon-envelope')); $toolbar->appendButton('Custom', $dhtml); // Render the popup button $dhtml = $layout->render(array('name' => 'print', 'doTask' => '', 'text' => JText::_('COM_ISSNREGISTRY_PUBLISHER_BUTTON_PRINT'), 'class' => 'icon-print')); $toolbar->appendButton('Custom', $dhtml); } JToolBarHelper::cancel('publisher.cancel', $isNew ? 'JTOOLBAR_CANCEL' : 'JTOOLBAR_CLOSE'); }
/** * Add the page title and toolbar. * * @return void * * @since 1.6 */ protected function addToolbar() { $state = $this->get('State'); $canDo = JHelperContent::getActions('com_messages'); JToolbarHelper::title(JText::_('COM_MESSAGES_MANAGER_MESSAGES'), 'envelope inbox'); if ($canDo->get('core.create')) { JToolbarHelper::addNew('message.add'); } if ($canDo->get('core.edit.state')) { JToolbarHelper::divider(); JToolbarHelper::publish('messages.publish', 'COM_MESSAGES_TOOLBAR_MARK_AS_READ', true); JToolbarHelper::unpublish('messages.unpublish', 'COM_MESSAGES_TOOLBAR_MARK_AS_UNREAD', true); } JToolbarHelper::divider(); $bar = JToolBar::getInstance('toolbar'); // Instantiate a new JLayoutFile instance and render the layout JHtml::_('behavior.modal', 'a.messagesSettings'); $layout = new JLayoutFile('toolbar.mysettings'); $bar->appendButton('Custom', $layout->render(array()), 'upload'); if ($state->get('filter.state') == -2 && $canDo->get('core.delete')) { JToolbarHelper::divider(); JToolbarHelper::deleteList('', 'messages.delete', 'JTOOLBAR_EMPTY_TRASH'); } elseif ($canDo->get('core.edit.state')) { JToolbarHelper::divider(); JToolbarHelper::trash('messages.trash'); } if ($canDo->get('core.admin')) { JToolbarHelper::preferences('com_messages'); } JToolbarHelper::divider(); JToolbarHelper::help('JHELP_COMPONENTS_MESSAGING_INBOX'); }
protected function addToolbar() { $canDo = JHelperContent::getActions($this->option, $this->edit_view, $this->state->get('filter.category_id')); $user = JFactory::getUser(); JToolbarHelper::title(ucfirst($this->view), 'address contact'); if ($canDo->get('core.create') || count($user->getAuthorisedCategories($this->option, 'core.create')) > 0) { JToolbarHelper::addNew($this->edit_view . '.add'); } if ($canDo->get('core.edit') || $canDo->get('core.edit.own')) { JToolbarHelper::editList($this->edit_view . '.edit'); } if ($canDo->get('core.edit.state')) { JToolbarHelper::publish($this->view . '.publish', 'JTOOLBAR_PUBLISH', true); JToolbarHelper::unpublish($this->view . '.unpublish', 'JTOOLBAR_UNPUBLISH', true); } if ($user->authorise('core.create', $this->option) && $user->authorise('core.edit', $this->option) && $user->authorise('core.edit.state', $this->option)) { $title = JText::_('JTOOLBAR_BATCH'); $layout = new JLayoutFile('joomla.toolbar.batch'); $dhtml = $layout->render(array('title' => $title)); } if ($this->state->get('filter.published') == -2 && $canDo->get('core.delete')) { JToolbarHelper::deleteList('', $this->view . '.delete', 'JTOOLBAR_EMPTY_TRASH'); } elseif ($canDo->get('core.edit.state')) { JToolbarHelper::deleteList($this->option, $this->view . '.delete', 'Delete'); } if ($user->authorise('core.admin', $this->option) || $user->authorise('core.options', $this->option)) { JToolbarHelper::preferences($this->option); } JHtmlSidebar::setAction('index.php?option=' . $this->option); }
/** * Add the page title and toolbar. * * @return void * * @since 1.6 */ protected function addToolbar() { // Get the toolbar object instance $bar = JToolbar::getInstance('toolbar'); $user = JFactory::getUser(); // Set the titlebar text JToolbarHelper::title(JText::_('COM_MEDIA'), 'images mediamanager'); // Add an upload button if ($user->authorise('core.create', 'com_media')) { // Instantiate a new JLayoutFile instance and render the layout $layout = new JLayoutFile('toolbar.uploadmedia'); $bar->appendButton('Custom', $layout->render(array()), 'upload'); JToolbarHelper::divider(); } // Add a create folder button if ($user->authorise('core.create', 'com_media')) { // Instantiate a new JLayoutFile instance and render the layout $layout = new JLayoutFile('toolbar.newfolder'); $bar->appendButton('Custom', $layout->render(array()), 'upload'); JToolbarHelper::divider(); } // Add a delete button if ($user->authorise('core.delete', 'com_media')) { // Instantiate a new JLayoutFile instance and render the layout $layout = new JLayoutFile('toolbar.deletemedia'); $bar->appendButton('Custom', $layout->render(array()), 'upload'); JToolbarHelper::divider(); } // Add a preferences button if ($user->authorise('core.admin', 'com_media') || $user->authorise('core.options', 'com_media')) { JToolbarHelper::preferences('com_media'); JToolbarHelper::divider(); } JToolbarHelper::help('JHELP_CONTENT_MEDIA_MANAGER'); }
/** * Add the page title and toolbar. * * @return void * * @since 1.6 */ protected function addToolBar() { JToolBarHelper::addNew('publisher.add'); JToolBarHelper::editList('publisher.edit'); JToolBarHelper::deleteList('', 'publishers.delete'); // Get the value of no_identifier filter $state = $this->state->get('filter.no_identifier'); // Check that we're showing publisher register if ($state == 5) { // Set page title JToolBarHelper::title(JText::_('COM_ISBNREGISTRY_PUBLISHERS_REGISTRY')); $toolbar = JToolBar::getInstance('toolbar'); $layout = new JLayoutFile('joomla.toolbar.popup'); // Render the popup button $dhtml = $layout->render(array('name' => 'statistics', 'doTask' => '', 'text' => JText::_('COM_ISBNREGISTRY_PUBLISHER_BUTTON_STATISTICS'), 'class' => 'icon-pie')); $toolbar->appendButton('Custom', $dhtml); } else { if ($state == 1) { JToolBarHelper::title(JText::_('COM_ISBNREGISTRY_PUBLISHERS_APPLICATION')); } else { JToolBarHelper::title(JText::_('COM_ISBNREGISTRY_PUBLISHERS')); } } // Has user rights to access preferences? if (JFactory::getUser()->authorise('core.admin', 'com_isbnregistry')) { JToolBarHelper::preferences('com_isbnregistry'); } }
/** * Fetch the HTML for the button * * @param string $type Unused string, formerly button type. * @param string $name Modal name, used to generate element ID * @param string $text The link text * @param string $url URL for popup * @param integer $width Width of popup * @param integer $height Height of popup * @param integer $top Top attribute. [@deprecated Unused, will be removed in 4.0] * @param integer $left Left attribute. [@deprecated Unused, will be removed in 4.0] * @param string $onClose JavaScript for the onClose event. * @param string $title The title text * * @return string HTML string for the button * * @since 3.0 */ public function fetchButton($type = 'Modal', $name = '', $text = '', $url = '', $width = 640, $height = 480, $top = 0, $left = 0, $onClose = '', $title = '') { // If no $title is set, use the $text element if (strlen($title) == 0) { $title = $text; } // Store all data to the options array for use with JLayout $options = array(); $options['name'] = trim(JText::_($name), '*?'); $options['text'] = JText::_($text); $options['title'] = JText::_($title); $options['class'] = $this->fetchIconClass($name); $options['doTask'] = $this->_getCommand($url); // Instantiate a new JLayoutFile instance and render the layout $layout = new JLayoutFile('joomla.toolbar.popup'); $html = array(); $html[] = $layout->render($options); // Place modal div and scripts in a new div $html[] = '<div class="btn-group" style="width: 0; margin: 0">'; // Build the options array for the modal $params = array(); $params['title'] = $options['title']; $params['url'] = $options['doTask']; $params['height'] = $height; $params['width'] = $width; $html[] = JHtml::_('bootstrap.renderModal', 'modal-' . $name, $params); // If an $onClose event is passed, add it to the modal JS object if (strlen($onClose) >= 1) { $html[] = '<script>' . 'jQuery(\'#modal-' . $name . '\').on(\'hide\', function () {' . $onClose . ';});' . '</script>'; } $html[] = '</div>'; return implode("\n", $html); }
public function onCCK_FieldPrepareContent(&$field, $value = '', &$config = array()) { if (self::$type != $field->type) { return; } parent::g_onCCK_FieldPrepareContent($field, $config); $html = ''; if ($value || ($config['client'] == 'list' || $config['client'] == 'item')) { $location = isset($config['location']) && $config['location'] ? $config['location'] : 'joomla_article'; $properties = array('context'); $properties = JCck::callFunc('plgCCK_Storage_Location' . $location, 'getStaticProperties', $properties); /* temporary fix for content categories */ if ($properties['context'] == 'com_categories.category') { $properties['context'] = 'com_content.category'; // todo: dynamic context per extension (#__categories) } /* temporary fix for content categories */ if (is_object($value) && isset($value->tags)) { $value = $value->tags; } $tags = new JHelperTags(); $tags->getItemTags($properties['context'], $config['pk']); $tagLayout = new JLayoutFile('joomla.content.tags'); $html = $tagLayout->render($tags->itemTags); } // Set $field->value = $value; $field->html = $html; }
function display($tpl = null) { //require_once( JPATH_COMPONENT.DS.'helpers'.DS.'sajax.php' ); $db = JFactory::getDBO(); $customer = $this->get('customer'); //print_r($customer);die; $user = $this->get('User'); $isNew = $customer->id < 1; $text = $isNew ? JText::_('COM_DIGICOM_NEW') : JText::_('COM_DIGICOM_EDIT') . " : " . $customer->firstname; JToolBarHelper::title(JText::_('COM_DIGICOM_CUSTOMER') . ":<small>[" . $text . "]</small>"); $bar = JToolBar::getInstance('toolbar'); $layout = new JLayoutFile('toolbar.title'); $title = array('title' => JText::_('COM_DIGICOM_CUSTOMER') . ":<small>[" . $text . "]</small>", 'class' => 'title'); $bar->appendButton('Custom', $layout->render($title), 'title'); $layout = new JLayoutFile('toolbar.settings'); $bar->appendButton('Custom', $layout->render(array()), 'settings'); JToolBarHelper::apply('customer.apply'); JToolBarHelper::save('customer.save'); JToolBarHelper::divider(); JToolBarHelper::cancel('customer.cancel'); $this->assign("cust", $customer); $this->assign("user", $user); $configs = $this->get("Configs"); $this->assign("configs", $configs); DigiComHelperDigiCom::addSubmenu('customers'); $this->sidebar = DigiComHelperDigiCom::renderSidebar(); parent::display($tpl); }
/** * Method to add a toolbar */ protected function addToolbar() { $state = $this->get('State'); $canDo = JDeveloperHelper::getActions(); $user = JFactory::getUser(); // Get the toolbar object instance $bar = JToolBar::getInstance('toolbar'); JToolBarHelper::title(JText::_('COM_JDEVELOPER_FORMS_VIEW_FORMS_TITLE')); if ($canDo->get('core.create')) { JToolBarHelper::addNew('form.add', 'JTOOLBAR_NEW'); } if (($canDo->get('core.edit') || $canDo->get('core.edit.own')) && isset($this->items[0])) { JToolBarHelper::editList('form.edit', 'JTOOLBAR_EDIT'); } if ($canDo->get('core.delete') && isset($this->items[0])) { JToolBarHelper::deleteList('', 'forms.delete', 'JTOOLBAR_DELETE'); } // Add a batch button if (isset($this->items[0]) && $user->authorise('core.create', 'com_contacts') && $user->authorise('core.edit', 'com_contacts')) { JHtml::_('bootstrap.modal', 'collapseModal'); $title = JText::_('JTOOLBAR_BATCH'); // Instantiate a new JLayoutFile instance and render the batch button $layout = new JLayoutFile('joomla.toolbar.batch'); $dhtml = $layout->render(array('title' => $title)); $bar->appendButton('Custom', $dhtml, 'batch'); } if ($canDo->get('core.admin')) { JToolBarHelper::preferences('com_jdeveloper'); } }
/** * Render the action bar title * * @param array $config An optional array with configuration options * @return string Html */ public function title($config = array()) { $config = new KObjectConfigJson($config); $config->append(array('command' => NULL)); $title = $this->getObject('translator')->translate($config->command->title); $icon = $config->command->icon; $html = ''; if (!empty($title)) { if (JFactory::getApplication()->isAdmin() && version_compare(JVERSION, '3.2', 'ge')) { $layout = new JLayoutFile('joomla.toolbar.title'); $html = $layout->render(array('title' => $title, 'icon' => $icon)); } elseif ($this->_useBootstrap()) { // Strip the extension. $icons = explode(' ', $icon); foreach ($icons as &$icon) { $icon = 'pagetitle--' . preg_replace('#\\.[^.]*$#', '', $icon); } $html = '<div class="pagetitle ' . htmlspecialchars(implode(' ', $icons)) . '"><h2>' . $title . '</h2></div>'; } else { $html = '<div class="header pagetitle icon-48-' . $icon . '">'; $html .= '<h2>' . $title . '</h2>'; $html .= '</div>'; } if (JFactory::getApplication()->isAdmin()) { $app = JFactory::getApplication(); $app->JComponentTitle = $html; $html = ''; JFactory::getDocument()->setTitle($app->getCfg('sitename') . ' - ' . JText::_('JADMINISTRATION') . ' - ' . $title); } } return $html; }
public function onMediaEditorDisplay($filePath) { // @suggestion: Add CSS, JavaScript $data = array('filePath' => $filePath); $layout = new JLayoutFile('form', __DIR__ . '/layout'); $html = $layout->render($data); return $html; }
/** * Method to return the HTML shown in a modal popup within the Media Manager * * @param $filePath string * * @return string */ public function onMediaEditorDisplay($filePath) { //todo: allow for setup of cropper parameters $data = array('filePath' => $filePath); $layout = new JLayoutFile('form', __DIR__ . '/layout'); $html = $layout->render($data); return $html; }
/** * Method to render the layout. * * @param string $layoutFile Dot separated path to the layout file, relative to base path * @param object $displayData Object which properties are used inside the layout file to build displayed output * @param string $basePath Base path to use when loading layout files * @param mixed $options Optional custom options to load. JRegistry or array format * * @return string * * @since 3.1 */ public static function render($layoutFile, $displayData = null, $basePath = '', $options = null) { $basePath = empty($basePath) ? self::$defaultBasePath : $basePath; // Make sure we send null to JLayoutFile if no path set $basePath = empty($basePath) ? null : $basePath; $layout = new JLayoutFile($layoutFile, $basePath, $options); $renderedLayout = $layout->render($displayData); return $renderedLayout; }
/** * Fetches the button HTML code. * * @param string $type Unused string. * @param string $ref The name of the help screen (its key reference). * @param boolean $com Use the help file in the component directory. * @param string $override Use this URL instead of any other. * @param string $component Name of component to get Help (null for current component) * * @return string * * @since 3.0 */ public function fetchButton($type = 'Help', $ref = '', $com = false, $override = null, $component = null) { // Store all data to the options array for use with JLayout $options = array(); $options['text'] = JText::_('JTOOLBAR_HELP'); $options['doTask'] = $this->_getCommand($ref, $com, $override, $component); // Instantiate a new JLayoutFile instance and render the layout $layout = new JLayoutFile('joomla.toolbar.help'); return $layout->render($options); }
/** * Render the batch selection options. * * @return string The necessary HTML to display the batch selection options * * @since 3.0 */ public static function render() { // Collect display data $data = new stdClass(); $data->ListSelection = static::getListSelection(); // Create a layout object and ask it to render the batch selection options $layout = new JLayoutFile('batchselection'); $batchHtml = $layout->render($data); return $batchHtml; }
/** * Add the page title and toolbar. * * @return void * * @since 1.6 */ protected function addToolbar() { // Add page title JToolbarHelper::title(JText::_('COM_MODULES_MANAGER_MODULES'), 'cube module'); // Get the toolbar object instance $bar = JToolbar::getInstance('toolbar'); // Instantiate a new JLayoutFile instance and render the layout $layout = new JLayoutFile('toolbar.cancelselect'); $bar->appendButton('Custom', $layout->render(array()), 'new'); }
/** * Add the page title and toolbar. * * @since 1.6 */ protected function addToolbar() { JToolBarHelper::title(JText::_('COM_DIGICOM_REPORTS_TOOLBAR_TITLE'), 'generic.png'); $bar = JToolBar::getInstance('toolbar'); // Instantiate a new JLayoutFile instance and render the layout $layout = new JLayoutFile('toolbar.title'); $title = array('title' => JText::_('COM_DIGICOM_SIDEBAR_MENU_REPORTS'), 'class' => 'title'); $bar->appendButton('Custom', $layout->render($title), 'title'); $layout = new JLayoutFile('toolbar.settings'); $bar->appendButton('Custom', $layout->render(array()), 'settings'); }
/** * Fetches the button HTML code. * * @param string $type Button type, unused string. * @param string $url The link url * @param string $text The button text * * @return string HTML string for the button * * @since 3.0 */ public function fetchButton($type = 'Print', $url = '', $text = 'COM_SIBDIET_TOOLBAR_PRINT', $loadScript = true) { // Store all data to the options array for use with JLayout $options = array(); $options['text'] = JText::_($text); $options['doTask'] = $this->_getCommand($url); $options['loadScript'] = $loadScript; // Instantiate a new JLayoutFile instance and render the layout $layout = new JLayoutFile('print', JPATH_COMPONENT . '/toolbar/layout/'); return $layout->render($options); }
/** * Fetch the HTML for the button * * @param string $type Unused string. * @param string $name Name to be used as apart of the id * @param string $text Button text * @param string $url The link url * * @return string HTML string for the button * * @since 3.0 */ public function fetchButton($type = 'Link', $name = 'back', $text = '', $url = null) { // Store all data to the options array for use with JLayout $options = array(); $options['text'] = JText::_($text); $options['class'] = $this->fetchIconClass($name); $options['doTask'] = $this->_getCommand($url); // Instantiate a new JLayoutFile instance and render the layout $layout = new JLayoutFile('joomla.toolbar.link'); return $layout->render($options); }
/** * Add the page title and toolbar. * * @since 1.6 */ protected function addToolbar() { JToolBarHelper::title(JText::_('COM_DIGICOM_DASHBOARD_TOOLBAR_TITLE'), 'generic.png'); $bar = JToolBar::getInstance('toolbar'); $layout = new JLayoutFile('toolbar.title'); $title = array('title' => JText::_('COM_DIGICOM_DASHBOARD_TOOLBAR_TITLE'), 'class' => 'product'); $bar->appendButton('Custom', $layout->render($title), 'title'); $layout = new JLayoutFile('toolbar.products'); $bar->appendButton('Custom', $layout->render(array()), 'products'); $layout = new JLayoutFile('toolbar.settings'); $bar->appendButton('Custom', $layout->render(array()), 'settings'); }
/** * Get the HTML for a separator in the toolbar * * @param array &$definition Class name and custom width * * @return string The HTML for the separator * * @see JToolbarButton::render() * @since 3.0 */ public function render(&$definition) { // Store all data to the options array for use with JLayout $options = array(); // Separator class name $options['class'] = empty($definition[1]) ? '' : $definition[1]; // Custom width $options['style'] = empty($definition[2]) ? '' : ' style="width:' . (int) $definition[2] . 'px;"'; // Instantiate a new JLayoutFile instance and render the layout $layout = new JLayoutFile('joomla.toolbar.separator'); return $layout->render($options); }
/** * Add the page title and toolbar. * * @since 1.6 */ protected function addToolbar() { $state = $this->get('State'); $canDo = JHelperContent::getActions('com_modules'); $user = JFactory::getUser(); // Get the toolbar object instance $bar = JToolBar::getInstance('toolbar'); JToolbarHelper::title(JText::_('COM_MODULES_MANAGER_MODULES'), 'cube module'); if ($canDo->get('core.create')) { // Instantiate a new JLayoutFile instance and render the layout $layout = new JLayoutFile('toolbar.newmodule'); $bar->appendButton('Custom', $layout->render(array()), 'new'); } if ($canDo->get('core.edit')) { JToolbarHelper::editList('module.edit'); } if ($canDo->get('core.create')) { JToolbarHelper::custom('modules.duplicate', 'copy.png', 'copy_f2.png', 'JTOOLBAR_DUPLICATE', true); } if ($canDo->get('core.edit.state')) { JToolbarHelper::publish('modules.publish', 'JTOOLBAR_PUBLISH', true); JToolbarHelper::unpublish('modules.unpublish', 'JTOOLBAR_UNPUBLISH', true); JToolbarHelper::checkin('modules.checkin'); } if ($state->get('filter.state') == -2 && $canDo->get('core.delete')) { JToolbarHelper::deleteList('', 'modules.delete', 'JTOOLBAR_EMPTY_TRASH'); } elseif ($canDo->get('core.edit.state')) { JToolbarHelper::trash('modules.trash'); } // Add a batch button if ($user->authorise('core.create', 'com_modules') && $user->authorise('core.edit', 'com_modules') && $user->authorise('core.edit.state', 'com_modules')) { JHtml::_('bootstrap.modal', 'collapseModal'); $title = JText::_('JTOOLBAR_BATCH'); // Instantiate a new JLayoutFile instance and render the batch button $layout = new JLayoutFile('joomla.toolbar.batch'); $dhtml = $layout->render(array('title' => $title)); $bar->appendButton('Custom', $dhtml, 'batch'); } if ($canDo->get('core.admin')) { JToolbarHelper::preferences('com_modules'); } JToolbarHelper::help('JHELP_EXTENSIONS_MODULE_MANAGER'); JHtmlSidebar::addEntry(JText::_('JSITE'), 'index.php?option=com_modules&filter_client_id=0', $this->state->get('filter.client_id') == 0); JHtmlSidebar::addEntry(JText::_('JADMINISTRATOR'), 'index.php?option=com_modules&filter_client_id=1', $this->state->get('filter.client_id') == 1); JHtmlSidebar::setAction('index.php?option=com_modules'); JHtmlSidebar::addFilter('', 'filter_client_id', JHtml::_('select.options', ModulesHelper::getClientOptions(), 'value', 'text', $this->state->get('filter.client_id')), false); JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_PUBLISHED'), 'filter_state', JHtml::_('select.options', ModulesHelper::getStateOptions(), 'value', 'text', $this->state->get('filter.state'))); JHtmlSidebar::addFilter(JText::_('COM_MODULES_OPTION_SELECT_POSITION'), 'filter_position', JHtml::_('select.options', ModulesHelper::getPositions($this->state->get('filter.client_id')), 'value', 'text', $this->state->get('filter.position'))); JHtmlSidebar::addFilter(JText::_('COM_MODULES_OPTION_SELECT_MODULE'), 'filter_module', JHtml::_('select.options', ModulesHelper::getModules($this->state->get('filter.client_id')), 'value', 'text', $this->state->get('filter.module'))); JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_ACCESS'), 'filter_access', JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access'))); JHtmlSidebar::addFilter(JText::_('JOPTION_SELECT_LANGUAGE'), 'filter_language', JHtml::_('select.options', JHtml::_('contentlanguage.existing', true, true), 'value', 'text', $this->state->get('filter.language'))); $this->sidebar = JHtmlSidebar::render(); }
/** * Add the page title and toolbar. * * @return void * * @since 1.6 */ protected function addToolBar() { JToolBarHelper::title(JText::_('COM_ISSNREGISTRY_FORMS')); JToolBarHelper::addNew('form.add'); JToolBarHelper::editList('form.edit'); JToolBarHelper::deleteList('', 'forms.delete'); $toolbar = JToolBar::getInstance('toolbar'); $layout = new JLayoutFile('joomla.toolbar.popup'); // Render the popup button $dhtml = $layout->render(array('name' => 'statistics', 'doTask' => '', 'text' => JText::_('COM_ISSNREGISTRY_STATISTICS_BUTTON'), 'class' => 'icon-pie')); $toolbar->appendButton('Custom', $dhtml); }
/** * Fetch the HTML for the button * * @param string $type Unused string. * @param string $msg Message to render * @param string $name Name to be used as apart of the id * @param string $text Button text * @param string $task The task associated with the button * @param boolean $list True to allow use of lists * @param boolean $hideMenu True to hide the menu on click * * @return string HTML string for the button * * @since 3.0 */ public function fetchButton($type = 'Confirm', $msg = '', $name = '', $text = '', $task = '', $list = true, $hideMenu = false) { // Store all data to the options array for use with JLayout $options = array(); $options['text'] = JText::_($text); $options['msg'] = JText::_($msg, true); $options['class'] = $this->fetchIconClass($name); $options['doTask'] = $this->_getCommand($options['msg'], $name, $task, $list); // Instantiate a new JLayoutFile instance and render the layout $layout = new JLayoutFile('joomla.toolbar.confirm'); return $layout->render($options); }
/** * Add the page title and toolbar. * * @return void * * @since 1.6 */ protected function addToolBar() { $input = JFactory::getApplication()->input; // Hide Joomla Administrator Main menu $input->set('hidemainmenu', true); $isNew = $this->item->id == 0; if ($isNew) { $title = JText::_('COM_ISSNREGISTRY_FORM_NEW'); } else { $title = JText::_('COM_ISSNREGISTRY_FORM_EDIT'); $title .= ' : ' . $this->item->publisher; } JToolBarHelper::title($title, 'form'); JToolbarHelper::apply('form.apply'); if (!$isNew) { // Add custom button for sending a message $toolbar = JToolBar::getInstance('toolbar'); $layout = new JLayoutFile('joomla.toolbar.popup'); // Load message model $messageModel = JModelLegacy::getInstance('message', 'IssnregistryModel'); // Get number of messages related to this form $msgCount = $messageModel->getMessageCountByFormId($this->item->id); // Add send message button if all the publications have ISSN if ($this->item->publication_count == $this->item->publication_count_issn) { // Get label based on sent message count $label = $msgCount == 0 ? JText::_('COM_ISSNREGISTRY_FORM_BUTTON_SEND_MESSAGE') : JText::_('COM_ISSNREGISTRY_FORM_BUTTON_SEND_MESSAGE_AGAIN'); // Render the popup button $dhtml = $layout->render(array('name' => 'generate-message', 'doTask' => '', 'text' => $label, 'class' => 'icon-envelope')); $toolbar->appendButton('Custom', $dhtml); } // Render the popup button $dhtml = $layout->render(array('name' => 'print', 'doTask' => '', 'text' => JText::_('COM_ISSNREGISTRY_FORM_BUTTON_PRINT'), 'class' => 'icon-print')); $toolbar->appendButton('Custom', $dhtml); } if (!$isNew && !$this->item->publisher_created && $this->item->publisher_id == 0) { JToolBarHelper::custom('form.createPublisher', 'new', 'new', JText::_('COM_ISSNREGISTRY_FORM_BUTTON_CREATE_PUBLISHER'), false, false); } JToolBarHelper::cancel('form.cancel', $isNew ? 'JTOOLBAR_CANCEL' : 'JTOOLBAR_CLOSE'); }
/** * Method to get the field label markup. * * @return string The field label markup. * * @since 3.3.7 */ protected function getLabel() { $label = parent::getLabel(); // Get the info text from the XML element, defaulting to empty. $text = $this->element['info'] ? (string) $this->element['info'] : ''; $text = $this->translateLabel ? JText::_($text) : $text; if ($text) { $layout = new JLayoutFile('plugins.user.profile.fields.dob'); $info = $layout->render(array('text' => $text)); $label = $info . $label; } return $label; }
function display($tpl = null) { JToolBarHelper::title(JText::_('COM_DIGICOM_ABOUT_TOOLBAR_TITLE'), 'generic.png'); $bar = JToolBar::getInstance('toolbar'); // Instantiate a new JLayoutFile instance and render the layout $layout = new JLayoutFile('toolbar.title'); $title = array('title' => JText::_('COM_DIGICOM_ABOUT_TOOLBAR_TITLE'), 'class' => 'title'); $bar->appendButton('Custom', $layout->render($title), 'title'); $layout = new JLayoutFile('toolbar.settings'); $bar->appendButton('Custom', $layout->render(array()), 'settings'); DigiComHelperDigiCom::addSubmenu('about'); $this->sidebar = DigiComHelperDigiCom::renderSidebar(); parent::display($tpl); }
/** * Add the page title and toolbar. * * @since 1.6 */ protected function addToolbar() { JToolBarHelper::title(JText::_('COM_DIGICOM_ORDERS_TOOLBAR_TITLE'), 'generic.png'); $bar = JToolBar::getInstance('toolbar'); // Instantiate a new JLayoutFile instance and render the layout $layout = new JLayoutFile('toolbar.title'); $title = array('title' => JText::_('COM_DIGICOM_ORDERS_TOOLBAR_TITLE'), 'class' => 'title'); $bar->appendButton('Custom', $layout->render($title), 'title'); $layout = new JLayoutFile('toolbar.settings'); $bar->appendButton('Custom', $layout->render(array()), 'settings'); JToolBarHelper::addNew('ordernew.add'); JToolBarHelper::divider(); JToolBarHelper::deleteList(JText::_('COM_DIGICOM_ORDERS_ALERT_REMOVE'), 'orders.remove'); JToolBarHelper::spacer(); }
/** * Add the page title and toolbar. * * @since 1.6 */ protected function addToolbar() { JToolBarHelper::title(JText::_('COM_DIGICOM_SETTINGS_TOOLBAR_TITLE')); $bar = JToolBar::getInstance('toolbar'); // Instantiate a new JLayoutFile instance and render the layout $layout = new JLayoutFile('toolbar.title'); $title = array('title' => JText::_('COM_DIGICOM_SETTINGS_TOOLBAR_TITLE'), 'class' => 'title'); $bar->appendButton('Custom', $layout->render($title), 'title'); $layout = new JLayoutFile('toolbar.settings'); $bar->appendButton('Custom', $layout->render(array()), 'settings'); JToolBarHelper::save('configs.save'); JToolBarHelper::apply('configs.apply'); JToolBarHelper::divider(); JToolBarHelper::cancel('configs.cancel', 'JTOOLBAR_CLOSE'); }
/** * Render the sidebar. * * @return string The necessary HTML to display the sidebar * * @since 3.0 */ public static function render() { // Collect display data $data = new stdClass(); $data->list = self::getEntries(); $data->filters = self::getFilters(); $data->action = self::getAction(); $data->displayMenu = count($data->list); $data->displayFilters = count($data->filters); $data->hide = JFactory::getApplication()->input->getBool('hidemainmenu'); // Create a layout object and ask it to render the sidebar $layout = new JLayoutFile('joomla.sidebars.submenu', JPATH_COMPONENT_ADMINISTRATOR . DS . 'helpers' . DS . 'layouts'); $sidebarHtml = $layout->render($data); return $sidebarHtml; }