/**
  * put your comment there...
  * 
  * @param mixed $tpl
  */
 protected function displayAction($tpl = null)
 {
     // Prepare inputs
     $this->model->inputs['blockId'] = $_REQUEST['blockId'];
     // Display view!
     parent::displayAction();
 }
Example #2
0
 /**
  * put your comment there...
  * 
  */
 public function __construct()
 {
     parent::__construct();
     // Register actions!
     $this->registryAction('install');
     $this->registryAction('dismissNotice');
 }
Example #3
0
 /**
  * put your comment there...
  * 
  */
 public function __construct()
 {
     parent::__construct();
     // Actions.
     $this->registryAction('manageForm');
     $this->registryAction('save');
     $this->registryAction('restoreDefault');
 }
Example #4
0
 /**
  * 
  * Initialize new object.
  * 
  * @return void
  */
 public function __construct()
 {
     // Initialize parent!
     parent::__construct();
     // Add actions.
     $this->registryAction('display');
     $this->registryAction('delete');
 }
 /**
  * Initialize controller object.
  * 
  * @see CJTController for more details
  * @return void
  */
 public function __construct()
 {
     parent::__construct();
     // Supported actions.
     add_action('wp_ajax_cjtoolbox_create', array(&$this, '_doAction'));
     add_action('wp_ajax_cjtoolbox_delete', array(&$this, '_doAction'));
     add_action('wp_ajax_cjtoolbox_list', array(&$this, '_doAction'));
     add_action('wp_ajax_cjtoolbox_restore', array(&$this, '_doAction'));
 }
Example #6
0
 /**
  * put your comment there...
  * 
  */
 protected function getLicenseFileAction()
 {
     // Get package model.
     $model =& $this->model;
     // Set action parameter.
     $model->setParam('file', 'license');
     // Load view.
     parent::displayAction();
 }
 /**
  * put your comment there...
  * 
  */
 public function __construct()
 {
     parent::__construct();
     // Actions!
     $this->registryAction('getList');
     $this->registryAction('delete');
     $this->registryAction('save');
     $this->registryAction('switch');
 }
Example #8
0
 /**
  * put your comment there...
  * 
  */
 public function __construct()
 {
     parent::__construct();
     // Actions!
     $this->registryAction('getBlockBy');
     $this->registryAction('getAPOP');
     $this->registryAction('loadUrl');
     $this->registryAction('getCode');
     $this->registryAction('downloadCodeFile');
 }
 /**
  * Initialize controller object.
  * 
  * @see CJTController for more details
  * @return void
  */
 public function __construct()
 {
     parent::__construct();
     // Register action.
     $this->registryAction('create_block');
     $this->registryAction('get_view');
     $this->registryAction('save_blocks');
     $this->registryAction('saveOrder');
     $this->registryAction('loadBlock');
 }
Example #10
0
 /**
  * put your comment there...
  * 
  */
 public function __construct($hasView = null, $request = null)
 {
     // Initialize parent!
     parent::__construct($hasView, $request);
     // Register actions!
     $this->registryAction('getBlocksList');
     $this->registryAction('getShortcode');
     $this->registryAction('getBlockParametersForm');
     // @TODO: $this->defaultCapability is risky if  there is any admin actions added later, please remove!
     $this->defaultCapability = array('edit_posts', 'edit_pages');
 }
Example #11
0
 /**
  * Initialize controller object.
  * 
  * @see CJTController for more details
  * @return void
  */
 public function __construct()
 {
     parent::__construct();
     // Supported actions.
     add_action('wp_ajax_cjtoolbox_get_info_view', array(&$this, '_doAction'));
     add_action('wp_ajax_cjtoolbox_set_property', array(&$this, '_doAction'));
     add_action('wp_ajax_cjtoolbox_get_revision', array(&$this, '_doAction'));
     add_action('wp_ajax_cjtoolbox_get_revisions', array(&$this, '_doAction'));
     // Redirects
     $this->registryAction('getBlockBy');
     $this->registryAction('getAPOP');
     $this->registryAction('restoreRevision');
     $this->registryAction('loadUrl');
     $this->registryAction('downloadCodeFile');
 }
 /**
  * put your comment there...
  * 
  */
 protected function displayAction()
 {
     // Set default filters.
     if (!isset($_REQUEST['filter_states'])) {
         $_REQUEST['filter_states'] = 'published';
     }
     // Save all filters!
     if ($_SERVER['REQUEST_METHOD'] == 'POST') {
         $filters = array_intersect_key($_REQUEST, array_flip(explode(',', $_REQUEST['allFiltersName'])));
         update_user_option(get_current_user_id(), self::SESSIONED_FILTERS, $filters);
     } else {
         // Load sessioned filter from database options table!
         $filters = (array) get_user_option(self::SESSIONED_FILTERS, get_current_user_id());
         $_REQUEST = array_merge($_REQUEST, $filters);
     }
     // Push inputs into the model!
     $this->model->inputs = $_REQUEST;
     // Display view.
     parent::displayAction();
 }
Example #13
0
 /**
  * Initialize post controller.
  * 
  * @return void
  */
 public function __construct($_unused_hasView = null, $request = null)
 {
     // Initialize parent.
     parent::__construct(false, $request);
     // Initialize.
     $postId = $this->getRequestParameter('post');
     // Instantiate model object.
     $this->model = self::getModel('metabox', array($postId));
     // Don't regiter Ajax actions unless AAP (Ajax Access Point) is loaded!
     $connectedObject =& CJTAccessPoint::isConnected();
     if ($connectedObject && $connectedObject->getName() == 'ajax') {
         $this->registryAction('create');
         $this->registryAction('delete');
     } else {
         if ($this->model->doPost()) {
             // Add metabox.
             $this->showMetabox();
         }
     }
 }
 /**
  * put your comment there...
  * 
  */
 protected function installAction()
 {
     // Initialize.
     $model =& $this->model;
     // Unzip and Parse package file when uploaded.
     if ($_SERVER['REQUEST_METHOD'] == 'POST') {
         // Get uploaded file.
         $file = $_FILES['fileToUpload'];
         try {
             // Parse/Unzip+Parse definition the package file.
             $package = $model->parse($file['name'], $file['tmp_name']);
             // Install package
             $packageId = $model->install($package);
         } catch (Exception $exception) {
             $this->model->setState('error', array('msg' => $exception->getMessage()));
         }
     }
     // Display uploader!
     parent::displayAction();
 }
Example #15
0
 /**
  * put your comment there...
  * 
  */
 protected function infoAction()
 {
     $this->model->inputs['id'] = (int) $_REQUEST['id'];
     // Display the view.
     parent::displayAction();
 }
Example #16
0
 /**
  * Display Activation form!
  * 
  */
 protected function activationFormViewAction()
 {
     // Display activation for for the requested component!
     parent::displayAction();
 }
    protected function redirect($controller)
    {
        // Initialize vars.
        $currentFilter = current_filter();
        // Remove current Action!
        remove_action($currentFilter, array(&$this, '_doAction'));
        // activate the target CTR!
        CJTController::getInstance($controller);
        // Fire the action manually.
        do_action($currentFilter);
    }
    /**
     * put your comment there...
     * 
     * @param mixed $action
     * @param mixed $priority
     * @param mixed $paramsCount
     */
    protected function registryAction($action, $priority = 10, $paramsCount = 1, $prefix = self::ACTION_PREFIX)
    {
        $action = "{$prefix}{$action}";
        $callback = $this->onregisteraction(array(&$this, '_doAction'), $action);
        // Adding action!
        add_action($action, $callback, $priority, $paramsCount);
        return $this;
    }
}
// End class.
// Hookable!
CJTAjaxController::define('CJTAjaxController', array('hookType' => CJTWordpressEvents::HOOK_FILTER));