Esempio n. 1
0
 function update()
 {
     $timestamp = mktime(0, 0, 0, $this->params['month'], 1);
     $endday = expDateTime::endOfMonthDay($timestamp);
     if ($this->params['day'] > $endday) {
         expValidator::failAndReturnToForm(gt('There are only') . ' ' . $endday . ' ' . gt('days in') . ' ' . $this->motd->months[$this->params['month']], $this->params);
     }
     parent::update();
 }
 public function update()
 {
     global $db;
     //reset others
     if ($this->params['is_default']) {
         $o->is_default = false;
         $db->updateObject($o, 'order_type', 'is_default=1');
     }
     parent::update();
 }
Esempio n. 3
0
 public function update()
 {
     //FIXME:  Remove this code once we have the new tag implementation
     if (!empty($this->params['tags'])) {
         global $db;
         if (isset($this->params['id'])) {
             $db->delete('content_expTags', 'content_type="image" AND content_id=' . $this->params['id']);
         }
         $tags = explode(",", $this->params['tags']);
         foreach ($tags as $tag) {
             $tag = strtolower(trim($tag));
             $expTag = new expTag($tag);
             if (empty($expTag->id)) {
                 $expTag->update(array('title' => $tag));
             }
             $this->params['expTag'][] = $expTag->id;
         }
     }
     //populate the alt tag field if the user didn't
     if (empty($this->params['alt'])) {
         $this->params['alt'] = $this->params['title'];
     }
     // call expController update to save the image
     parent::update();
 }