Example #1
0
 /**
  * @see AbstractController::run()
  */
 public function run(Resource $resource)
 {
     $uriParams = $resource->getParams();
     $formParams = RequestManager::getAllParams();
     $uc = new UserPreferencesController();
     $uc->getUserPreference(Utils::getLoggedInUserId());
     $this->populateProgramData($uriParams, $formParams);
     $this->getView()->setViewName(self::MODULE_KEY)->display();
 }
Example #2
0
 /**
  * @see AbstractController::run()
  */
 public function run(Resource $resource)
 {
     $inputParams = $resource->getParams();
     $pid = $inputParams[Constants::INPUT_PARAM_ACTION];
     if (!empty($pid)) {
         $this->downloadFile($pid);
     } else {
         throw new Exception("No File Info Provided!");
     }
 }
Example #3
0
 public function run(Resource $resource)
 {
     $uriParams = $resource->getParams();
     $formParams = RequestManager::getAllParams();
     if (!empty($formParams[self::FILE_UPLOAD_ACTION_NAME]) && $formParams[self::FILE_UPLOAD_ACTION_NAME] == self::FILE_UPLOAD_ACTION_VALUE) {
         $this->uploadFile($formParams);
     } else {
         $this->getView()->setViewName(self::MODULE_KEY)->display();
     }
 }
 public function run(Resource $resource)
 {
     $uriParams = $resource->getParams();
     $formParams = RequestManager::getAllParams();
     if (strtolower($uriParams[Constants::INPUT_PARAM_ACTION]) === 'save') {
         if ($this->saveUserPreference($formParams)) {
             Response::sendResponse(Constants::SUCCESS_RESPONSE, Messages::SUCCESS_UPDATE);
         } else {
             Response::sendResponse(Constants::SUCCESS_RESPONSE, Messages::ERROR_OPERATION_FAILED);
         }
     }
 }
Example #5
0
 /**
  * @see AbstractController::run()
  */
 public function run(Resource $resource)
 {
     $uriParams = $resource->getParams();
     $formParams = RequestManager::getAllParams();
     if ($this->isDeleteRequest($uriParams, $formParams)) {
         $pid = $uriParams[Constants::INPUT_PARAM_PID];
         if (!empty($pid) && is_numeric($pid)) {
             $this->deleteSource($pid);
         }
     } else {
         $pid = $uriParams[Constants::INPUT_PARAM_PID];
         $language = $uriParams[Constants::INPUT_PARAM_LANG];
         $category = $uriParams[Constants::INPUT_PARAM_CATE];
         $this->exploreCode($language, $category, $pid);
     }
 }
Example #6
0
 /**
  * @see AbstractController::run()
  */
 public function run(Resource $resource)
 {
     $uriParams = $resource->getParams();
     $formParams = RequestManager::getAllParams();
     if (!$this->isEditRequest($formParams)) {
         if (is_numeric($uriParams[Constants::INPUT_PARAM_ACTION])) {
             $this->setBean(array('pid' => $uriParams[Constants::INPUT_PARAM_ACTION]));
         } else {
             $this->setBean(array('pid' => null));
         }
         $this->getView()->setViewName(self::MODULE_KEY)->display();
     } else {
         if (!$this->isUpdateRequest($formParams)) {
             $this->getModel()->submitCode($formParams);
         } else {
             $this->getModel()->updateCode($formParams);
         }
     }
 }
Example #7
0
 /**
  * @see AbstractController::run()
  */
 public function run(Resource $resource)
 {
     $uriParams = $resource->getParams();
     $contentKey = $uriParams[Constants::INPUT_PARAM_ACTION];
     $this->getView()->setViewName($contentKey)->display();
 }