コード例 #1
0
ファイル: abstract.php プロジェクト: bgao-ca/moodle-local_mr
 /**
  * Remove preferences for this filter
  *
  * @param string $name A specific preference to delete, if NULL all are deleted
  * @return mr_html_filter_abstract
  */
 public function preferences_delete($name = NULL)
 {
     if (is_null($name)) {
         $names = array_keys($this->preferences_defaults());
     } else {
         $names = array($name);
     }
     foreach ($names as $name) {
         $this->preferences->delete($name);
     }
     return $this;
 }
コード例 #2
0
ファイル: table.php プロジェクト: bgao-ca/moodle-local_mr
 /**
  * Store sort and weight based on current settings
  *
  * @return void
  */
 protected function save_sortorder()
 {
     // Store sorting information if necessary
     if ($this->sort != $this->defaultsort) {
         // Sort not the same as default, save
         $this->preferences->set('sort', $this->sort);
     } else {
         // Sort same as default, remove
         $this->preferences->delete('sort');
     }
     if ($this->order != $this->defaultorder) {
         // Order not the same as default, save
         $this->preferences->set('order', $this->order);
     } else {
         // Order same as default, remove
         $this->preferences->delete('order');
     }
 }