Ejemplo n.º 1
0
 protected function _commandPreview(KControllerToolbarCommand $command)
 {
     $state = $this->getController()->getModel()->getState();
     $template = $state->name;
     $base = $state->application == 'site' ? JURI::root() : JURI::base();
     $command->append(array('width' => '640', 'height' => '480'))->append(array('attribs' => array('href' => $base . 'index.php?tp=1&template=' . $template, 'target' => 'preview')));
 }
Ejemplo n.º 2
0
 protected function _commandPurge(KControllerToolbarCommand $command)
 {
     $command->append(array(
         'attribs' => array(
             'data-novalidate'   => 'novalidate'
         )
     ));
 }
Ejemplo n.º 3
0
 protected function _commandUnpublish(KControllerToolbarCommand $command)
 {
     $command->append(array(
         'attribs'  => array(
             'data-action' => 'edit',
             'data-data'   => '{state:0}'
         )
     )); 
 }
Ejemplo n.º 4
0
 protected function _commandBack(KControllerToolbarCommand $command)
 {
     if (version_compare(JVERSION, '3.0', '>=')) {
         $command->icon = 'icon-32-arrow-left';
     }
     if (!isset($command->href)) {
         $command->append(array('attribs' => array('data-action' => $command->getName())));
     }
 }
Ejemplo n.º 5
0
 protected function _commandDefault(KControllerToolbarCommand $command)
 {
     $command->label = JText::_('Make Default');
     
     $command->append(array(
     	'attribs' => array(
             'data-action' => 'edit',
             'data-data'   => '{default:1}'
         )
     ));
 }
Ejemplo n.º 6
0
 /**
  * Modal toolbar command
  * 
  * @param   object  A KControllerToolbarCommand object
  * @return  void
  */
 protected function _commandModal(KControllerToolbarCommand $command)
 {
     $option = $this->getIdentifier()->package;
     $command->append(array('width' => '640', 'height' => '480', 'href' => ''))->append(array('attribs' => array('class' => array('modal'), 'href' => $command->href, 'rel' => '{handler: \'iframe\', size: {x: ' . $command->width . ', y: ' . $command->height . '}}')));
 }
Ejemplo n.º 7
0
 protected function _commandPreferences(KControllerToolbarCommand $command)
 {
     JHTML::_('behavior.modal');
     $option = $this->getIdentifier()->package;
     $command->append(array('width' => '640', 'height' => '480', 'href' => ''))->append(array('attribs' => array('class' => array('modal'), 'href' => 'index.php?option=com_config&view=component&component=com_portfolio&path=&tmpl=component', 'rel' => '{handler: \'iframe\', size: {x: ' . $command->width . ', y: ' . $command->height . '}}')));
 }
Ejemplo n.º 8
0
 protected function _commandOptions(KControllerToolbarCommand $command)
 {
     $command->append(array('attribs' => array('href' => JRoute::_('index.php?option=com_docman&view=config'))));
 }
Ejemplo n.º 9
0
 /**
  * Get a command by name
  *
  * @param string $name  The command name
  * @param array $config An optional associative array of configuration settings
  * @return KControllerToolbarCommandInterface|boolean A toolbar command if found, false otherwise.
  */
 public function getCommand($name, $config = array())
 {
     if (!isset($this->_commands[$name])) {
         //Create the config object
         $command = new KControllerToolbarCommand($name, $config);
         //Attach the command to the toolbar
         $command->setToolbar($this);
         //Find the command function to call
         if (method_exists($this, '_command' . ucfirst($name))) {
             $function = '_command' . ucfirst($name);
             $this->{$function}($command);
         } else {
             //Don't set an action for GET commands
             if (!isset($command->href)) {
                 $command->append(array('attribs' => array('data-action' => $command->getName())));
             }
         }
     } else {
         $command = $this->_commands[$name];
     }
     return $command;
 }
 protected function _commandDelete(KControllerToolbarCommand $command)
 {
     $command->icon = 'icon-32-delete';
     $command->label = 'Uninstall';
     $command->append(array('attribs' => array('data-action' => 'delete')));
 }
Ejemplo n.º 11
0
 protected function _commandDelete(KControllerToolbarCommand $command)
 {
     $command->append(array('attribs' => array('data-url' => 'index.php?option=com_logs&view=logs', 'data-action' => 'delete')));
 }
Ejemplo n.º 12
0
 /**
  * Options Toolbar Command
  *
  * @param   KControllerToolbarCommand $command  A KControllerToolbarCommand object
  * @return  void
  */
 protected function _commandOptions(KControllerToolbarCommand $command)
 {
     $option = $this->getIdentifier()->package;
     $icon = 'options';
     if (version_compare(JVERSION, '3.0', '>=')) {
         $return = urlencode(base64_encode(JUri::getInstance()));
         $link = 'option=com_config&view=component&component=com_' . $option . '&path=&return=' . $return;
     } else {
         JHtml::_('behavior.modal');
         $link = 'option=com_config&view=component&component=com_' . $option . '&path=&tmpl=component';
         $command->append(array('attribs' => array('rel' => "{handler: 'iframe', size: {x: 875, y: 550}, onClose: function() {}}", 'class' => array('modal'))));
     }
     $command->icon = sprintf('icon-32-%s', $icon);
     // Need to do a JRoute call here, otherwise component is turned into option in the query string by our router
     $command->attribs['href'] = JRoute::_('index.php?' . $link, false);
 }
Ejemplo n.º 13
0
 /**
  * Get a command by name
  *
  * @param string $name  The command name
  * @param array $config An optional associative array of configuration settings
  * @return mixed ControllerToolbarCommand if found, false otherwise.
  */
 public function getCommand($name, $config = array())
 {
     if (!$this->getDelegate()->hasCommand($name)) {
         //Create the config object
         $command = new KControllerToolbarCommand($name, $config);
         //Attach the command to the toolbar
         $command->setToolbar($this);
         //Find the command function to call
         if (method_exists($this, '_command' . ucfirst($name))) {
             $function = '_command' . ucfirst($name);
             $this->{$function}($command);
         } else {
             $this->getDelegate()->getCommand($name, $config);
         }
     } else {
         $command = $this->getDelegate()->getCommand($name);
     }
     return $command;
 }
Ejemplo n.º 14
0
 public function _commandCheckin(KControllerToolbarCommand $command)
 {
     $command->icon = 'checkin';
     $command->label = JText::_('Checkin');
     $command->append(array('attribs' => array('data-action' => 'checkin', 'data-novalidate' => 'novalidate')));
 }
Ejemplo n.º 15
0
 public function _commandIndex(KControllerToolbarCommand $command)
 {
     $command->icon = 'refresh';
     $command->label = JText::_('Index');
     $command->append(array('attribs' => array('data-action' => 'index', 'data-novalidate' => 'novalidate')));
 }
Ejemplo n.º 16
0
 /**
  * Modal toolbar command
  *
  * @param   KControllerToolbarCommand $command  A KControllerToolbarCommand object
  * @return  void
  */
 protected function _commandDialog(KControllerToolbarCommand $command)
 {
     $command->append(array('href' => ''))->append(array('attribs' => array('class' => array('koowa-modal'), 'href' => $command->href, 'data-koowa-modal' => array('type' => 'iframe'))));
     $command->attribs['data-koowa-modal'] = json_encode($command->attribs['data-koowa-modal']);
 }