示例#1
0
 protected function buildInternal()
 {
     parent::buildInternal();
     $ds = new SwatDetailsStore($this->tag);
     $ds->photo_count = $this->tag->getPhotoCount();
     $details_view = $this->ui->getWidget('details_view');
     $details_view->data = $ds;
     $details_frame = $this->ui->getWidget('details_frame');
     $details_frame->title = Pinhole::_('Tag');
     $details_frame->subtitle = $this->tag->title;
     $this->ui->getWidget('for_sale')->visible = $this->ui->getWidget('not_for_sale')->visible = $this->ui->getWidget('for_sale_divider')->visible = $this->app->config->clustershot->username !== null;
     $this->buildToolbar();
 }
示例#2
0
 protected function saveDBData()
 {
     $values = $this->ui->getValues(array('title', 'name', 'event', 'archived'));
     $this->tag->title = $values['title'];
     $this->tag->name = $values['name'];
     $this->tag->event = $values['event'];
     $this->tag->archived = $values['archived'];
     if ($this->id === null) {
         $now = new SwatDate();
         $this->tag->createdate = $now->getDate();
     }
     $flush_cache = $this->tag->isModified() && $this->tag->id !== null;
     $this->tag->save();
     $this->addToSearchQueue();
     if (isset($this->app->memcache) && $flush_cache) {
         $this->app->memcache->flushNs('photos');
     }
     $message = new SwatMessage(sprintf(Pinhole::_('“%s” has been saved.'), $this->tag->title));
     $this->app->messages->add($message);
 }