Example #1
0
	/**
     * Initializes the default configuration for the object
     *
     * Called from {@link __construct()} as a first step of object instantiation.
     *
     * @param 	object 	An optional KConfig object with configuration options.
     * @return void
     */
    protected function _initialize(KConfig $config)
    {
        parent::_initialize($config);
        
        //Only render the menubar
        $config->render = array('menubar');
    }
Example #2
0
 public function _afterGet(KCommandContext $context)
 {
     if ($this->_toolbar) {
         $layout = $context->caller->getView()->getLayout();
         if ($context->caller->getIdentifier()->name == 'file') {
             if ($layout === 'default') {
                 $this->getToolbar()->addUpload(array('label' => 'Upload', 'is_allowed' => $this->canAdd()))->addNew(array('label' => 'New Folder', 'is_allowed' => $this->canAdd()))->addDelete(array('is_allowed' => $this->canDelete()))->addSeparator()->addCommand('create-documents', array('label' => 'Create Documents', 'icon' => 'icon-32-save-new', 'is_allowed' => $this->canAdd()))->addRefresh();
                 if ($this->canAdmin()) {
                     $this->getToolbar()->addSeparator()->addOptions();
                 }
             } elseif ($layout === 'form') {
                 if ($this->canAdd()) {
                     $this->getToolbar()->addApply(array('is_allowed' => $this->canAdd()));
                 }
                 $this->getToolbar()->addBack();
                 // Hide menubar for these layouts
                 $key = array_search('menubar', $this->_render);
                 if ($key) {
                     unset($this->_render[$key]);
                 }
             }
         }
     }
     parent::_afterGet($context);
 }
 public function _afterGet(KCommandContext $context)
 {
     if ($this->_toolbar) {
         if ($this->canAdd()) {
             $this->getToolbar()->addCommand('upload');
             $this->getToolbar()->addNew(array('label' => 'New Folder'));
         }
         if ($this->canDelete()) {
             $this->getToolbar()->addDelete();
         }
         $this->getToolbar()->addRefresh();
         if (version_compare(JVERSION, '1.6.0', '>=') && JFactory::getUser()->authorise('core.admin', 'com_fileman')) {
             $this->getToolbar()->addModal(array('icon' => 'icon-32-options', 'label' => 'Options', 'href' => 'index.php?option=com_config&view=component&component=com_fileman&path=&tmpl=component'));
         }
     }
     parent::_afterGet($context);
 }