Exemple #1
0
 public function __construct()
 {
     parent::__construct();
     $this->add_stylesheet(MIDCOM_STATIC_URL . '/midcom.admin.help/style-editor.css');
     midcom::get('head')->add_jsfile(MIDCOM_STATIC_URL . '/midcom.admin.help/twisty.js');
     if (defined('MGD_TYPE_NONE')) {
         $this->mgdtypes[MGD_TYPE_NONE] = 'none';
     }
     midcom::get('componentloader')->load_library('net.nehmer.markdown');
 }
Exemple #2
0
 /**
  * Get the plugin handlers, which act alike with Request Switches of MidCOM
  * Baseclasses Components (midcom.baseclasses.components.request)
  *
  * @return mixed Array of the plugin handlers
  */
 public function get_plugin_handlers()
 {
     $return = parent::get_plugin_handlers();
     if ($GLOBALS['midcom_config']['symlinks']) {
         /**
          * Create a new topic symlink
          *
          * Match /createlink/
          */
         $return['createlink'] = array('handler' => array('midcom_admin_folder_handler_edit', 'edit'), 'fixed_args' => array('createlink'));
     }
     return $return;
 }
Exemple #3
0
 /**
  * Prepares the actual plugin by adding all necessary information to the request
  * switch.
  *
  * @param string $namespace The plugin namespace to use.
  * @param string $plugin The plugin to load from the namespace.
  * @return boolean Indicating Success
  */
 public function _prepare_plugin($namespace, $plugin)
 {
     $handlers = $this->_active_plugin->get_plugin_handlers();
     foreach ($handlers as $identifier => $handler_config) {
         // First, update the fixed args list (be tolerant here)
         if (!array_key_exists('fixed_args', $handler_config)) {
             $handler_config['fixed_args'] = array($namespace, $plugin);
         } else {
             if (!is_array($handler_config['fixed_args'])) {
                 $handler_config['fixed_args'] = array($namespace, $plugin, $handler_config['fixed_args']);
             } else {
                 $handler_config['fixed_args'] = array_merge(array($namespace, $plugin), $handler_config['fixed_args']);
             }
         }
         $handler_config['plugin'] = $this->_active_plugin->_component;
         $this->_request_switch["__{$namespace}-{$plugin}-{$identifier}"] = $handler_config;
     }
     return true;
 }