Example #1
0
 function __construct()
 {
     $this->ResourceController = ResourceController::getSingleton();
     $this->createResourcePostType();
     add_action('add_meta_boxes_resource', array(&$this, 'addMetaBoxesForResource'));
     add_action('save_post', array(&$this->ResourceController, 'save'));
 }
Example #2
0
function setRequest()
{
    $resourceController = ResourceController::getSingleton();
    if (isset($_POST['action_type'])) {
        $result = $resourceController->actionHandler($_POST);
        return $result;
    }
    if (isset($_GET['query'])) {
        $result = $resourceController->actionHandlerGet($_GET);
        return $result;
    }
    if (isset($_GET['expression'])) {
        $_GET['action_type'] = ResourceController::SEARCH_ACTION;
        $result = $resourceController->actionHandler($_GET);
        return $result;
    }
}
Example #3
0
 public static function getResourcesByQuery($expression)
 {
     $query = ResourceController::constructQuery($expression);
     $resources = ResourceService::getSingleton()->findResourcesBy($query);
     return $resources;
 }