コード例 #1
0
 function execute(ActionMapping $map, ActionForm $form, Request $req)
 {
     global $papyrine;
     $papyrine->entries =& $papyrine->getEntries();
     // Instantiate the HTML_QuickForm object
     require_once 'HTML/QuickForm.php';
     require_once 'HTML/QuickForm/group.php';
     $form = new HTML_QuickForm('create_entry');
     $form->addElement('text', 'title', 'Title:');
     $form->addElement('text', 'date', 'Date:');
     $form->addElement('text', 'status', 'Status:');
     // Get the default handler
     $form->addElement('text', 'body', 'Body:');
     $form->addElement('submit', null, 'Create');
     // Define filters and validation rules
     $form->applyFilter('name', 'trim');
     $form->addRule('name', 'Please enter your name', 'required', null, 'client');
     //get classes registered for entry
     //call method
     $plugin = new PapyrinePlugin(BASE . 'plugins/categories/');
     $object = $plugin->getInstance();
     $object->recieveNewEntryForm($form);
     $plugin = new PapyrinePlugin(BASE . 'plugins/comments/');
     $object = $plugin->getInstance();
     $object->recieveNewEntryForm($form);
     // Output the form
     $papyrine->form = $form->toHTML();
     header("Content-Type: application/xhtml+xml;charset=UTF-8");
     $papyrine->display('admin/header.html');
     $papyrine->display($map->getParameter());
     $papyrine->display('admin/footer.html');
 }
コード例 #2
0
 function __construct()
 {
     // Choose DB from config
     parent::__construct();
     $this->addPath('template', BASE . 'templates/');
     // Hardwire SQLite
     $plugin = new PapyrinePlugin(BASE . 'plugins/database-sqlite/');
     $this->database = $plugin->getInstance();
 }
コード例 #3
0
 function execute(ActionMapping $map, ActionForm $form, Request $req)
 {
     global $papyrine;
     $sections = array("Entries" => SITE . 'administration/entries', "Users" => SITE . 'administration/users', "Plugin Manager" => SITE . 'administration/plugins');
     $plugin = new PapyrinePlugin(BASE . 'plugins/categories/');
     $object = $plugin->getInstance();
     $object->recieveSectionArray($sections);
     $plugin = new PapyrinePlugin(BASE . 'plugins/comments/');
     $object = $plugin->getInstance();
     $object->recieveSectionArray($sections);
     $papyrine->sections =& $sections;
     header("Content-Type: application/xhtml+xml;charset=UTF-8");
     $papyrine->display('admin/header.html');
     $papyrine->display($map->getParameter());
     $papyrine->display('admin/footer.html');
 }
コード例 #4
0
 function __construct()
 {
     parent::__construct("about.xml");
 }
コード例 #5
0
 function __construct()
 {
     parent::__construct();
     $GLOBALS["papyrine"]->RegisterHook("comment_display_url", "StripPageRank", $this);
 }