Exemplo n.º 1
0
 /**
  * Displays the search form
  *
  * @author Michael Klier <*****@*****.**>
  */
 private function xhtml_search_form()
 {
     global $lang;
     ptln('<div class="level1">');
     $blogs = $this->entryhelper->get_blogs();
     $form = new Doku_Form(array('id' => 'blogtng__search_form'));
     $form->startFieldset($lang['btn_search']);
     $form->addHidden('page', 'blogtng');
     $form->addHidden('btng[admin]', 'search');
     $form->addElement(form_makeListBoxField('btng[query][blog]', $blogs, $_REQUEST['btng']['query']['blog'], $this->getLang('blog')));
     $form->addElement(form_makeListBoxField('btng[query][filter]', array('entry_title', 'entry_author', 'comment', 'comment_ip', 'tags'), $_REQUEST['btng']['query']['filter'], $this->getLang('filter')));
     $form->addElement(form_makeTextField('btng[query][string]', $_REQUEST['btng']['query']['string'], ''));
     $form->addElement(form_makeButton('submit', 'admin', $lang['btn_search']));
     $form->endFieldset();
     html_form('blogtng__search_form', $form);
     ptln('</div>');
 }
Exemplo n.º 2
0
<?php

$blogtng_meta__excluded_syntax = array('info', 'blogtng_commentreply', 'blogtng_blog', 'blogtng_readmore', 'blogtng_header', 'blogtng_topic');
$meta['default_commentstatus'] = array('multichoice', '_choices' => array('enabled', 'closed', 'disabled'));
$meta['default_blog'] = array('multichoice', '_choices' => helper_plugin_blogtng_entry::get_blogs());
$meta['default_tags'] = array('string');
$meta['comments_allow_web'] = array('onoff');
$meta['comments_subscription'] = array('onoff');
$meta['comments_gravatar_rating'] = array('multichoice', '_choices' => array('X', 'R', 'PG', 'G'));
$meta['comments_gravatar_default'] = array('multichoice', '_choices' => array('blank', 'default', 'identicon', 'monsterid', 'wavatar'));
$meta['comments_forbid_syntax'] = array('multicheckbox', '_choices' => array_diff(plugin_list('syntax'), $blogtng_meta__excluded_syntax));
$meta['comments_xhtml_renderer'] = array('multicheckbox', '_choices' => array_diff(plugin_list('syntax'), $blogtng_meta__excluded_syntax));
$meta['editform_set_date'] = array('onoff');
$meta['tags'] = array('string');
$meta['receive_linkbacks'] = array('onoff');
$meta['send_linkbacks'] = array('onoff');
Exemplo n.º 3
0
 /**
  * Save the blog related meta data of a page to the sqlite DB
  *
  * @param Doku_Event $event
  * @param $param
  */
 function handle_action_act_preprocess(Doku_Event $event, $param)
 {
     list($type) = $param;
     switch ($type) {
         case 'before':
             if (is_array($event->data)) {
                 list($this->preact) = array_keys($event->data);
             } else {
                 $this->preact = $event->data;
             }
             break;
         case 'after':
             global $ID;
             if ($this->preact != 'save' || $event->data != 'show') {
                 return;
             }
             // does the page still exist? might be a deletion
             if (!page_exists($ID)) {
                 return;
             }
             $blog = $this->tools->getParam('post/blog');
             $blogs = $this->entryhelper->get_blogs();
             if (!in_array($blog, $blogs)) {
                 $blog = null;
             }
             if ($blog === null) {
                 $this->entryhelper->poke();
             } else {
                 $pid = md5($ID);
                 $this->entryhelper->load_by_pid($pid);
                 $entry = $this->_collectInfoForEntry();
                 $this->entryhelper->set($entry);
                 $this->entryhelper->entry['blog'] = $blog;
                 $this->entryhelper->entry['commentstatus'] = $this->tools->getParam('post/commentstatus');
                 if (empty($this->entryhelper->entry['page'])) {
                     $this->entryhelper->entry['page'] = $ID;
                 }
                 // allow to override created date
                 if ($this->tools->getParam('post/date') && $this->getConf('editform_set_date')) {
                     foreach (array('hh', 'mm', 'MM', 'DD') as $key) {
                         $_REQUEST['btng']['post']['date'][$key] = $_REQUEST['btng']['post']['date'][$key][0] == 0 ? $_REQUEST['btng']['post']['date'][$key][1] : $_REQUEST['btng']['post']['date'][$key];
                     }
                     $time = mktime($this->tools->getParam('post/date/hh'), $this->tools->getParam('post/date/mm'), 0, $this->tools->getParam('post/date/MM'), $this->tools->getParam('post/date/DD'), $this->tools->getParam('post/date/YY'));
                     $this->entryhelper->entry['created'] = $time;
                 }
                 $this->entryhelper->save();
                 $tags = $this->_get_post_tags();
                 if ($tags === false) {
                     $tags = array();
                 }
                 $allowed_tags = $this->_get_allowed_tags();
                 if (count($allowed_tags) > 0) {
                     foreach ($tags as $n => $tag) {
                         if (!in_array($tag, $allowed_tags)) {
                             unset($tags[$n]);
                         }
                     }
                 }
                 $this->taghelper->load($pid);
                 $this->taghelper->setTags($tags);
                 $this->taghelper->save();
             }
             break;
     }
 }