protected function doprocessform(twidget $widget)
 {
     extract($_POST, EXTR_SKIP);
     if (isset($addwidget)) {
         $widget->add();
     } elseif (isset($sapeoptions)) {
         $widget->user = $user;
         $widget->force = isset($force);
     } else {
         $widget->counts[$widget->id] = (int) $maxcount;
     }
 }
 protected function create()
 {
     parent::create();
     $this->adminclass = 'tadminexcerptslide';
     $this->addmap('items', array());
     $this->tags = tcategories::i();
 }
 protected function create()
 {
     parent::create();
     $this->basename = 'widgets.custom';
     $this->adminclass = 'tadmincustomwidget';
     $this->addmap('items', array());
     $this->addevents('added', 'deleted');
 }
 protected function create()
 {
     parent::create();
     $this->adminclass = 'tadminsingletagwidget';
     $this->basename = 'widget.singletag';
     $this->addmap('items', array());
     $this->tags = tcategories::i();
 }
 protected function create()
 {
     parent::create();
     $this->basename = 'widget.meta';
     $this->template = 'meta';
     $this->adminclass = 'tadminmetawidget';
     $this->addmap('items', array());
 }
 protected function create()
 {
     parent::create();
     $this->basename = 'widget.comments';
     $this->cache = 'include';
     $this->template = 'comments';
     $this->adminclass = 'tadminmaxcount';
     $this->data['maxcount'] = 7;
 }
示例#7
0
 public function getwidget($id, $sidebar)
 {
     if ($this->user == '') {
         return '';
     }
     if (litepublisher::$urlmap->is404 || litepublisher::$urlmap->adminpanel) {
         return '';
     }
     return parent::getwidget($id, $sidebar);
 }
 protected function create()
 {
     parent::create();
     $this->basename = 'widget.friends';
     $this->template = 'friends';
     $this->adminclass = 'tadminfriendswidget';
     $this->data['maxcount'] = 0;
     $this->data['redir'] = true;
     $this->data['redirlink'] = '/foaflink.htm';
 }
示例#9
0
 public function create()
 {
     parent::create();
     $this->basename = 'keywords' . DIRECTORY_SEPARATOR . 'index';
     $this->cache = 'nocache';
     $this->adminclass = 'tadminkeywords';
     $this->data['count'] = 6;
     $this->data['notify'] = true;
     $this->data['trace'] = true;
     $this->addmap('links', array());
 }
 protected function create()
 {
     parent::create();
     $this->addevents('added', 'deleted');
     $this->basename = 'widgets.links';
     $this->template = 'links';
     $this->adminclass = 'tadminlinkswidget';
     $this->addmap('items', array());
     $this->addmap('autoid', 0);
     $this->redirlink = '/linkswidget/';
     $this->data['redir'] = false;
 }
示例#11
0
 public function getwidgetcontent($id, $sidebar)
 {
     if (!isset($this->items[$id])) {
         return false;
     }
     switch ($this->items[$id]['cache']) {
         case 'cache':
             $cache = twidgetscache::i();
             $result = $cache->getcontent($id, $sidebar);
             break;
         case 'include':
             $filename = twidget::getcachefilename($id, $sidebar);
             $result = litepublisher::$urlmap->cache->get($filename);
             if (!$result) {
                 $widget = $this->getwidget($id);
                 $result = $widget->getcontent($id, $sidebar);
                 litepublisher::$urlmap->cache->set($filename, $result);
             }
             break;
         case 'nocache':
         case 'code':
         case false:
             $widget = $this->getwidget($id);
             $result = $widget->getcontent($id, $sidebar);
             break;
     }
     return $result;
 }
示例#12
0
 protected function create()
 {
     parent::create();
     $this->adminclass = 'tadmintagswidget';
     $this->data['sortname'] = 'count';
     $this->data['showcount'] = true;
     $this->data['showsubitems'] = true;
     $this->data['maxcount'] = 0;
 }
示例#13
0
 protected function doprocessform(twidget $widget)
 {
     $widget->maxcount = (int) $_POST['maxcount'];
     $widget->postschanged();
     return parent::doprocessform($widget);
 }
 public function deletewidgets(twidget $widget)
 {
     $widgets = twidgets::i();
     $widgets->lock();
     $widget->lock();
     foreach ($_POST as $key => $value) {
         if (strbegin($key, 'widgetcheck-')) {
             $widget->delete((int) $value);
         }
     }
     $widget->unlock();
     $widgets->unlock();
 }
示例#15
0
 protected function create()
 {
     parent::create();
     $this->basename = 'widget.archives';
     $this->template = 'archives';
     $this->adminclass = 'tadminshowcount';
     $this->data['showcount'] = false;
 }