| @@ -36,8 +36,10 @@ | ||
| 36 | 36 | $this->registryAction('getAPOP'); |
| 37 | 37 | $this->registryAction('loadUrl'); |
| 38 | 38 | $this->registryAction('getCode'); |
| 39 | 39 | $this->registryAction('downloadCodeFile'); |
| 40 | + $this->registryAction('getAllAssignment'); | |
| 41 | + $this->registryAction('getCodeFilesCount'); | |
| 40 | 42 | } |
| 41 | 43 | |
| 42 | 44 | /** |
| 43 | 45 | * put your comment there... |
| @@ -74,8 +76,37 @@ | ||
| 74 | 76 | // Output code. |
| 75 | 77 | $this->response = $codeFile->code; |
| 76 | 78 | } |
| 77 | 79 | |
| 80 | + | |
| 81 | + /** | |
| 82 | + * put your comment there... | |
| 83 | + * | |
| 84 | + */ | |
| 85 | + public function getAllAssignmentAction() { | |
| 86 | + | |
| 87 | + $blockId = isset($_GET['blockId']) ? esc_html($_GET['blockId']) : null; | |
| 88 | + | |
| 89 | + try { | |
| 90 | + | |
| 91 | + if (!$blockId) { | |
| 92 | + | |
| 93 | + throw new Exception('Invalid Request parameters'); | |
| 94 | + } | |
| 95 | + | |
| 96 | + $blocks = new CJTBlocksModel(); | |
| 97 | + | |
| 98 | + $block = $blocks->getBlock($blockId); | |
| 99 | + | |
| 100 | + $this->response = count(CJTBlocksModel::getAllAssignments($block)); | |
| 101 | + } | |
| 102 | + catch (Exception $exception) { | |
| 103 | + | |
| 104 | + | |
| 105 | + } | |
| 106 | + | |
| 107 | + } | |
| 108 | + | |
| 78 | 109 | /** |
| 79 | 110 | * Query single block based on the provided criteria! |
| 80 | 111 | * |
| 81 | 112 | */ |
| @@ -87,8 +118,34 @@ | ||
| 87 | 118 | $inputs['filter'] = $_GET['filter']; |
| 88 | 119 | // Query Block. |
| 89 | 120 | $this->response = array_intersect_key((array) $this->model->getBlockBy(), $returns); |
| 90 | 121 | } |
| 122 | + | |
| 123 | + /** | |
| 124 | + * put your comment there... | |
| 125 | + * | |
| 126 | + */ | |
| 127 | + protected function getCodeFilesCountAction() { | |
| 128 | + | |
| 129 | + | |
| 130 | + $blockId = isset($_GET['blockId']) ? esc_html($_GET['blockId']) : null; | |
| 131 | + | |
| 132 | + try { | |
| 133 | + | |
| 134 | + if (!$blockId) { | |
| 135 | + | |
| 136 | + throw new Exception('Invalid Request parameters'); | |
| 137 | + } | |
| 138 | + | |
| 139 | + $this->response = count(CJTBlocksModel::getCodeFilesCount($blockId)); | |
| 140 | + } | |
| 141 | + catch (Exception $exception) { | |
| 142 | + | |
| 143 | + | |
| 144 | + } | |
| 145 | + | |
| 146 | + | |
| 147 | + } | |
| 91 | 148 | |
| 92 | 149 | /** |
| 93 | 150 | * Get assigment panel objects page. |
| 94 | 151 | * |