/** * Setup the Toolbar * * @since 1.6 */ protected function _setToolbar() { 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 = ModulesHelper::getActions($this->state->get('filter.category_id'), $this->item->id); $client = $this->get('client'); JToolBarHelper::title(JText::_('Modules_Manager_Module')); if ($this->item->module == 'mod_custom') { JToolBarHelper::Preview('index.php?option=com_modules&tmpl=component&client=' . $client->id . '&pollid=' . $this->item->id); } // If not checked out, can save the item. if (!$checkedOut && $canDo->get('core.edit')) { JToolBarHelper::apply('module.apply', 'JToolbar_Apply'); JToolBarHelper::save('module.save', 'JToolbar_Save'); JToolBarHelper::addNew('module.save2new', 'JToolbar_Save_and_new'); } // If an existing item, can save to a copy. if (!$isNew && $canDo->get('core.create')) { JToolBarHelper::custom('module.save2copy', 'copy.png', 'copy_f2.png', 'JToolbar_Save_as_Copy', false); } if (empty($this->item->id)) { JToolBarHelper::cancel('module.cancel', 'JToolbar_Cancel'); } else { JToolBarHelper::cancel('module.cancel', 'JToolbar_Close'); } JToolBarHelper::help('screen.module.edit'); }
function display($tpl = null) { $document = JFactory::getDocument(); $document->addStyleSheet('components/com_mijopolls/assets/css/mijopolls.css'); $cid = JRequest::getVar('cid', array(0), '', 'array'); $edit = JRequest::getVar('edit', true); $text = $edit ? JText::_('Edit') : JText::_('New'); JToolBarHelper::title(JText::_('COM_MIJOPOLLS_POLL') . ': <small><small>[ ' . $text . ' ]</small></small>', 'mijopolls'); JToolBarHelper::Preview('index.php?option=com_mijopolls&cid[]=' . $cid[0]); JToolBarHelper::save(); JToolBarHelper::apply(); JToolBarHelper::cancel(); $this->mainframe = JFactory::getApplication(); $user = JFactory::getUser(); $row = $this->get('ItemData'); // fail if checked out not by 'me' if ($row->isCheckedOut($user->get('id'))) { $msg = JText::sprintf('DESCBEINGEDITTED', JText::_('COM_MIJOPOLLS_THE_POLL'), $row->title); $this->setRedirect('index.php?option=com_mijopolls', $msg); } if ($row->id == 0) { $row->published = 1; } $options = array(); $ordering = array(); if ($edit) { $options = $row->getOptions($row->id); } else { $row->lag = 24 * 60; } //default colors for slices $colors = array("ff0000", "ffff99", "00ccff", "66ff99", "ffcc00", "d7ebff", "ccffcc", "cccccc", "ffff00", "006699", "660000", "ffddee"); $task = JRequest::getCmd('task'); if (MijopollsHelper::is15()) { $tpl .= '15'; $params = new JParameter($row->params, JPATH_COMPONENT . '/views/poll/poll.xml'); $this->params = $params; } else { if (MijopollsHelper::is30()) { $tpl = '30'; $this->params = $this->get('Form'); } else { if ($task != 'preview') { $tpl = '25'; $this->params = $this->get('Form'); } } } $this->row = $row; $this->options = $options; $this->color = $colors; $this->edit = $edit; parent::display($tpl); }
/** * Draws the menu for Editing an existing module */ function _EDIT($client) { $moduleType = JRequest::getCmd('module'); $cid = JRequest::getVar('cid', array(0), '', 'array'); JArrayHelper::toInteger($cid, array(0)); JToolBarHelper::title(JText::_('Module') . ': <small><small>[ ' . JText::_('Edit') . ' ]</small></small>', 'module.png'); if ($moduleType == 'custom') { JToolBarHelper::Preview('index.php?option=com_modules&tmpl=component&client=' . $client->id . '&pollid=' . $cid[0]); } JToolBarHelper::save(); JToolBarHelper::apply(); if ($cid[0]) { // for existing items the button is renamed `close` JToolBarHelper::cancel('cancel', 'Close'); } else { JToolBarHelper::cancel(); } JToolBarHelper::help('screen.modules.edit'); }
function display($tpl = null) { $document =& JFactory::getDocument(); $document->addStyleSheet('components/com_acepolls/assets/css/acepolls.css'); $cid = JRequest::getVar('cid', array(0), '', 'array'); $edit = JRequest::getVar('edit', true); $text = $edit ? JText::_('Edit') : JText::_('New'); JToolBarHelper::title(JText::_('COM_ACEPOLLS_POLL') . ': <small><small>[ ' . $text . ' ]</small></small>', 'acepolls'); JToolBarHelper::Preview('index.php?option=com_acepolls&cid[]=' . $cid[0]); JToolBarHelper::save(); JToolBarHelper::apply(); JToolBarHelper::cancel(); $this->mainframe = JFactory::getApplication(); $user =& JFactory::getUser(); $row = $this->get('ItemData'); // fail if checked out not by 'me' if ($row->isCheckedOut($user->get('id'))) { $msg = JText::sprintf('DESCBEINGEDITTED', JText::_('COM_ACEPOLLS_THE_POLL'), $row->title); $this->setRedirect('index.php?option=com_acepolls', $msg); } if ($row->id == 0) { // defaults $row->published = 1; } $options = array(); $ordering = array(); if ($edit) { $options = $row->getOptions($row->id); } else { $row->lag = 24 * 60; } //default colors for slices $colors = array("ff0000", "ffff99", "00ccff", "66ff99", "ffcc00", "d7ebff", "ccffcc", "cccccc", "ffff00", "006699", "660000", "ffddee"); $this->assignRef('row', $row); $this->assignRef('options', $options); $this->assignRef('params', $this->get('Form')); $this->assignRef('color', $colors); $this->assignRef('edit', $edit); parent::display($tpl); }
/** * Draws the menu for Editing an existing module */ function _EDIT($client) { $config = plgSystemAdvancedModulesConfig(); $moduleType = JRequest::getCmd('module'); $cid = JRequest::getVar('cid', array(0), '', 'array'); JArrayHelper::toInteger($cid, array(0)); JToolBarHelper::title(JText::_('AMM_MODULE') . ': <small><small>[ ' . JText::_('Edit') . ' ]</small></small>', 'module.png'); if ($moduleType == 'custom') { JToolBarHelper::Preview('index.php?option=com_advancedmodules&tmpl=component&client=' . $client->id . '&pollid=' . $cid['0']); } JToolBarHelper::save(); JToolBarHelper::apply(); if ($cid['0']) { // for existing items the button is renamed `close` JToolBarHelper::cancel('cancel', 'Close'); } else { JToolBarHelper::cancel(); } if ($config->show_config_in_item) { JToolBarHelper::preferences('com_advancedmodules', '500'); } JToolBarHelper::help('screen.modules.edit'); }
<?php defined('_JEXEC') or die('Restricted access'); ?> <?php $cid = JRequest::getVar('cid', array(0), '', 'array'); $edit = JRequest::getVar('edit', true); JArrayHelper::toInteger($cid, array(0)); $text = $edit ? JText::_('Edit') : JText::_('New'); JToolBarHelper::title(JText::_('Poll') . ': <small><small>[ ' . $text . ' ]</small></small>'); JToolBarHelper::Preview('index.php?option=com_poll&controller=poll&cid[]=' . $cid[0]); JToolBarHelper::save(); JToolBarHelper::apply(); if ($edit) { // for existing items the button is renamed `close` JToolBarHelper::cancel('cancel', 'Close'); } else { JToolBarHelper::cancel(); } JToolBarHelper::help('screen.polls.edit'); ?> <?php JFilterOutput::objectHTMLSafe($this->poll, ENT_QUOTES); ?> <script language="javascript" type="text/javascript"> function submitbutton(pressbutton) { var form = document.adminForm; if (pressbutton == 'cancel') {