@@ -51,15 +51,15 @@ discard block |
||
| 51 | 51 | /** |
| 52 | 52 | * Displays the title + grid |
| 53 | 53 | */ |
| 54 | - public function display() |
|
| 54 | + public function display() |
|
| 55 | 55 | { |
| 56 | - // action links |
|
| 57 | - echo '<div class="actions" style="margin-bottom:20px">'; |
|
| 56 | + // action links |
|
| 57 | + echo '<div class="actions" style="margin-bottom:20px">'; |
|
| 58 | 58 | echo '<a href="grade_models.php">'.Display::return_icon('back.png',get_lang('Back'),'','32').'</a>'; |
| 59 | - echo '<a href="'.api_get_self().'?action=add">'.Display::return_icon('add.png',get_lang('Add'),'','32').'</a>'; |
|
| 60 | - echo '</div>'; |
|
| 59 | + echo '<a href="'.api_get_self().'?action=add">'.Display::return_icon('add.png',get_lang('Add'),'','32').'</a>'; |
|
| 60 | + echo '</div>'; |
|
| 61 | 61 | echo Display::grid_html('grade_model'); |
| 62 | - } |
|
| 62 | + } |
|
| 63 | 63 | |
| 64 | 64 | /** |
| 65 | 65 | * Returns a Form validator Obj |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | $form->addElement('hidden', 'maxvalue', '100'); |
| 119 | - $form->addElement('hidden', 'minvalue', '0'); |
|
| 119 | + $form->addElement('hidden', 'minvalue', '0'); |
|
| 120 | 120 | $renderer = & $form->defaultRenderer(); |
| 121 | 121 | |
| 122 | 122 | $component_array = array(); |
@@ -193,7 +193,7 @@ discard block |
||
| 193 | 193 | // Setting the rules |
| 194 | 194 | $form->addRule('name', get_lang('ThisFieldIsRequired'), 'required'); |
| 195 | 195 | |
| 196 | - return $form; |
|
| 196 | + return $form; |
|
| 197 | 197 | } |
| 198 | 198 | |
| 199 | 199 | /** |
@@ -216,8 +216,8 @@ discard block |
||
| 216 | 216 | */ |
| 217 | 217 | public function save($params, $show_query = false) |
| 218 | 218 | { |
| 219 | - $id = parent::save($params, $show_query); |
|
| 220 | - if (!empty($id)) { |
|
| 219 | + $id = parent::save($params, $show_query); |
|
| 220 | + if (!empty($id)) { |
|
| 221 | 221 | foreach ($params['components'] as $component) { |
| 222 | 222 | if (!empty($component['title']) && !empty($component['percentage']) && !empty($component['acronym'])) { |
| 223 | 223 | $obj = new GradeModelComponents(); |
@@ -228,7 +228,7 @@ discard block |
||
| 228 | 228 | } |
| 229 | 229 | |
| 230 | 230 | //event_system(LOG_CAREER_CREATE, LOG_CAREER_ID, $id, api_get_utc_datetime(), api_get_user_id()); |
| 231 | - return $id; |
|
| 231 | + return $id; |
|
| 232 | 232 | } |
| 233 | 233 | |
| 234 | 234 | /** |
@@ -257,7 +257,7 @@ discard block |
||
| 257 | 257 | */ |
| 258 | 258 | public function delete($id) |
| 259 | 259 | { |
| 260 | - parent::delete($id); |
|
| 260 | + parent::delete($id); |
|
| 261 | 261 | } |
| 262 | 262 | |
| 263 | 263 | public function fill_grade_model_select_in_form(&$form, $name = 'gradebook_model_id', $default_value = null) |
@@ -305,11 +305,11 @@ discard block |
||
| 305 | 305 | /** |
| 306 | 306 | * GradeModelComponents constructor. |
| 307 | 307 | */ |
| 308 | - public function __construct() |
|
| 308 | + public function __construct() |
|
| 309 | 309 | { |
| 310 | 310 | parent::__construct(); |
| 311 | 311 | $this->table = Database::get_main_table(TABLE_GRADE_MODEL_COMPONENTS); |
| 312 | - } |
|
| 312 | + } |
|
| 313 | 313 | |
| 314 | 314 | /** |
| 315 | 315 | * @param array $params |
@@ -318,7 +318,7 @@ discard block |
||
| 318 | 318 | */ |
| 319 | 319 | public function save($params, $show_query = false) |
| 320 | 320 | { |
| 321 | - $id = parent::save($params, $show_query); |
|
| 321 | + $id = parent::save($params, $show_query); |
|
| 322 | 322 | |
| 323 | 323 | return $id; |
| 324 | 324 | } |
@@ -259,10 +259,10 @@ |
||
| 259 | 259 | } |
| 260 | 260 | |
| 261 | 261 | /** |
| 262 | - * @param $form |
|
| 262 | + * @param CatForm $form |
|
| 263 | 263 | * @param string $name |
| 264 | 264 | * @param null $default_value |
| 265 | - * @return bool |
|
| 265 | + * @return false|null |
|
| 266 | 266 | */ |
| 267 | 267 | public function fill_grade_model_select_in_form(&$form, $name = 'gradebook_model_id', $default_value = null) |
| 268 | 268 | { |
@@ -15,7 +15,7 @@ discard block |
||
| 15 | 15 | */ |
| 16 | 16 | public function __construct() |
| 17 | 17 | { |
| 18 | - $this->table = Database::get_main_table(TABLE_GRADE_MODEL); |
|
| 18 | + $this->table = Database::get_main_table(TABLE_GRADE_MODEL); |
|
| 19 | 19 | } |
| 20 | 20 | |
| 21 | 21 | /** |
@@ -54,8 +54,8 @@ discard block |
||
| 54 | 54 | { |
| 55 | 55 | // action links |
| 56 | 56 | echo '<div class="actions" style="margin-bottom:20px">'; |
| 57 | - echo '<a href="grade_models.php">'.Display::return_icon('back.png',get_lang('Back'),'','32').'</a>'; |
|
| 58 | - echo '<a href="'.api_get_self().'?action=add">'.Display::return_icon('add.png',get_lang('Add'),'','32').'</a>'; |
|
| 57 | + echo '<a href="grade_models.php">'.Display::return_icon('back.png', get_lang('Back'), '', '32').'</a>'; |
|
| 58 | + echo '<a href="'.api_get_self().'?action=add">'.Display::return_icon('add.png', get_lang('Add'), '', '32').'</a>'; |
|
| 59 | 59 | echo '</div>'; |
| 60 | 60 | echo Display::grid_html('grade_model'); |
| 61 | 61 | } |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | $form->addElement('hidden', 'components['.$i.'][id]', null); |
| 128 | 128 | |
| 129 | 129 | $template_percentage = |
| 130 | - '<div id=' . $i . ' style="display: '.(($i<=$nr_items)?'inline':'none').';" class="form-group"> |
|
| 130 | + '<div id='.$i.' style="display: '.(($i <= $nr_items) ? 'inline' : 'none').';" class="form-group"> |
|
| 131 | 131 | <label for="" class="col-sm-2 control-label"> |
| 132 | 132 | {label} |
| 133 | 133 | </label> |
@@ -141,11 +141,11 @@ discard block |
||
| 141 | 141 | |
| 142 | 142 | $template_title = |
| 143 | 143 | ' {element} <!-- BEGIN error --> <span class="form_error">{error}</span><!-- END error --> |
| 144 | - <a href="javascript:plusItem(' . ($counter+1) . ')"> |
|
| 145 | - '.Display::return_icon('add.png', get_lang('Add'), ['id' => 'plus-' . ($counter+1), 'style' => 'display: '.(($counter>=$nr_items) ? 'inline':'none') ]).' |
|
| 144 | + <a href="javascript:plusItem(' . ($counter + 1).')"> |
|
| 145 | + '.Display::return_icon('add.png', get_lang('Add'), ['id' => 'plus-'.($counter + 1), 'style' => 'display: '.(($counter >= $nr_items) ? 'inline' : 'none')]).' |
|
| 146 | 146 | </a> |
| 147 | - <a href="javascript:minItem(' . ($counter) . ')"> |
|
| 148 | - '.Display::return_icon('delete.png', get_lang('Delete'), ['id' => 'min-' . ($counter), 'style' => 'display: '.(($counter>=$nr_items) ? 'inline':'none') ]).' |
|
| 147 | + <a href="javascript:minItem(' . ($counter).')"> |
|
| 148 | + '.Display::return_icon('delete.png', get_lang('Delete'), ['id' => 'min-'.($counter), 'style' => 'display: '.(($counter >= $nr_items) ? 'inline' : 'none')]).' |
|
| 149 | 149 | </a> |
| 150 | 150 | </div></div>'; |
| 151 | 151 | |
@@ -312,7 +312,7 @@ discard block |
||
| 312 | 312 | public function __construct() |
| 313 | 313 | { |
| 314 | 314 | parent::__construct(); |
| 315 | - $this->table = Database::get_main_table(TABLE_GRADE_MODEL_COMPONENTS); |
|
| 315 | + $this->table = Database::get_main_table(TABLE_GRADE_MODEL_COMPONENTS); |
|
| 316 | 316 | } |
| 317 | 317 | |
| 318 | 318 | /** |
@@ -110,8 +110,8 @@ |
||
| 110 | 110 | //With this function we can add actions to the jgrid (edit, delete, etc) |
| 111 | 111 | $action_links = 'function action_formatter(cellvalue, options, rowObject) { |
| 112 | 112 | return \'<a href="?action=edit&id=\'+options.rowId+\'">'.Display::return_icon('edit.png',get_lang('Edit'),'',ICON_SIZE_SMALL).'</a>'. |
| 113 | - ' <a onclick="javascript:if(!confirm('."\'".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"),ENT_QUOTES))."\'".')) return false;" href="?sec_token='.$token.'&action=delete&id=\'+options.rowId+\'">'.Display::return_icon('delete.png',get_lang('Delete'),'',ICON_SIZE_SMALL).'</a>'. |
|
| 114 | - '\'; |
|
| 113 | + ' <a onclick="javascript:if(!confirm('."\'".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"),ENT_QUOTES))."\'".')) return false;" href="?sec_token='.$token.'&action=delete&id=\'+options.rowId+\'">'.Display::return_icon('delete.png',get_lang('Delete'),'',ICON_SIZE_SMALL).'</a>'. |
|
| 114 | + '\'; |
|
| 115 | 115 | }'; |
| 116 | 116 | ?> |
| 117 | 117 | <script> |
@@ -20,7 +20,7 @@ discard block |
||
| 20 | 20 | $htmlHeadXtra[] = api_get_jqgrid_js(); |
| 21 | 21 | |
| 22 | 22 | // setting breadcrumbs |
| 23 | -$interbreadcrumb[]=array('url' => 'index.php','name' => get_lang('PlatformAdmin')); |
|
| 23 | +$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin')); |
|
| 24 | 24 | |
| 25 | 25 | $action = isset($_GET['action']) ? $_GET['action'] : null; |
| 26 | 26 | |
@@ -28,16 +28,16 @@ discard block |
||
| 28 | 28 | $token = Security::get_token(); |
| 29 | 29 | |
| 30 | 30 | if ($action == 'add') { |
| 31 | - $interbreadcrumb[]=array('url' => 'grade_models.php','name' => get_lang('GradeModel')); |
|
| 32 | - $interbreadcrumb[]=array('url' => '#','name' => get_lang('Add')); |
|
| 31 | + $interbreadcrumb[] = array('url' => 'grade_models.php', 'name' => get_lang('GradeModel')); |
|
| 32 | + $interbreadcrumb[] = array('url' => '#', 'name' => get_lang('Add')); |
|
| 33 | 33 | } elseif ($action == 'edit') { |
| 34 | - $interbreadcrumb[]=array('url' => 'grade_models.php','name' => get_lang('GradeModel')); |
|
| 35 | - $interbreadcrumb[]=array('url' => '#','name' => get_lang('Edit')); |
|
| 34 | + $interbreadcrumb[] = array('url' => 'grade_models.php', 'name' => get_lang('GradeModel')); |
|
| 35 | + $interbreadcrumb[] = array('url' => '#', 'name' => get_lang('Edit')); |
|
| 36 | 36 | } else { |
| 37 | - $interbreadcrumb[]=array('url' => '#','name' => get_lang('GradeModel')); |
|
| 37 | + $interbreadcrumb[] = array('url' => '#', 'name' => get_lang('GradeModel')); |
|
| 38 | 38 | } |
| 39 | 39 | |
| 40 | -$htmlHeadXtra[]= '<script> |
|
| 40 | +$htmlHeadXtra[] = '<script> |
|
| 41 | 41 | function plusItem(item) { |
| 42 | 42 | if (item != 1) { |
| 43 | 43 | document.getElementById(item).style.display = "inline"; |
@@ -109,8 +109,8 @@ discard block |
||
| 109 | 109 | |
| 110 | 110 | //With this function we can add actions to the jgrid (edit, delete, etc) |
| 111 | 111 | $action_links = 'function action_formatter(cellvalue, options, rowObject) { |
| 112 | - return \'<a href="?action=edit&id=\'+options.rowId+\'">'.Display::return_icon('edit.png',get_lang('Edit'),'',ICON_SIZE_SMALL).'</a>'. |
|
| 113 | - ' <a onclick="javascript:if(!confirm('."\'".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"),ENT_QUOTES))."\'".')) return false;" href="?sec_token='.$token.'&action=delete&id=\'+options.rowId+\'">'.Display::return_icon('delete.png',get_lang('Delete'),'',ICON_SIZE_SMALL).'</a>'. |
|
| 112 | + return \'<a href="?action=edit&id=\'+options.rowId+\'">'.Display::return_icon('edit.png', get_lang('Edit'), '', ICON_SIZE_SMALL).'</a>'. |
|
| 113 | + ' <a onclick="javascript:if(!confirm('."\'".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"), ENT_QUOTES))."\'".')) return false;" href="?sec_token='.$token.'&action=delete&id=\'+options.rowId+\'">'.Display::return_icon('delete.png', get_lang('Delete'), '', ICON_SIZE_SMALL).'</a>'. |
|
| 114 | 114 | '\'; |
| 115 | 115 | }'; |
| 116 | 116 | ?> |
@@ -155,7 +155,7 @@ discard block |
||
| 155 | 155 | $obj->display(); |
| 156 | 156 | } else { |
| 157 | 157 | echo '<div class="actions">'; |
| 158 | - echo '<a href="'.api_get_self().'">'.Display::return_icon('back.png',get_lang('Back'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
| 158 | + echo '<a href="'.api_get_self().'">'.Display::return_icon('back.png', get_lang('Back'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
| 159 | 159 | echo '</div>'; |
| 160 | 160 | $form->addElement('hidden', 'sec_token'); |
| 161 | 161 | $form->setConstants(array('sec_token' => $token)); |
@@ -177,7 +177,7 @@ discard block |
||
| 177 | 177 | $obj->display(); |
| 178 | 178 | } else { |
| 179 | 179 | echo '<div class="actions">'; |
| 180 | - echo '<a href="'.api_get_self().'">'.Display::return_icon('back.png',get_lang('Back'),'',ICON_SIZE_MEDIUM).'</a>'; |
|
| 180 | + echo '<a href="'.api_get_self().'">'.Display::return_icon('back.png', get_lang('Back'), '', ICON_SIZE_MEDIUM).'</a>'; |
|
| 181 | 181 | echo '</div>'; |
| 182 | 182 | $form->addElement('hidden', 'sec_token'); |
| 183 | 183 | $form->setConstants(array('sec_token' => $token)); |