<?php
class NP_Textile extends NucleusPlugin {
 
   function getName() { return 'Textile'; }
   function getAuthor()  { return 'fungus'; }
   function getURL()  { return 'http://www.fungusmovies.com/'; }
   function getVersion() { return '0.1'; }
   function getDescription() {
      return 'This will allow you to type up items using Dean Allen\'s Textile.';
   }
 
   function install() {
     $this->createOption('textileDefault','Use by default:','yesno','yes');
   }
   function getEventList() {
     return array('AddItemFormExtras','EditItemFormExtras','PreAddItem','PreUpdateItem');
   }
 
   function event_PreAddItem($data) {
     $bTextile = FALSE;
     if ($this->getOption('textileDefault') == 'yes') $bTextile = TRUE;
     if (requestVar('textile_on') != 'yes') $bTextile = FALSE;
     if (!$bTextile) return;
     include "textile.php";
     $data['body'] = textile($data['body']);
     $data['more'] = textile($data['more']);
   }
   function event_PreUpdateItem($data) {
     $this->event_PreAddItem($data);
   }
 
   function event_AddItemFormExtras($data) {
     if ($this->getOption('textileDefault') != 'yes') return;
     echo "<p><a href=\"plugins/textilehelp.txt\" target=\"_blank\">Textile</a>?<input type=\"checkbox\" name=\"textile_on\" value=\""
         ."yes\" checked></p>";
   }
   function event_EditItemFormExtras($data) {
     $this->event_AddItemFormExtras($data);
   }
}
?>
textilecode.txt · Last modified: 2006/07/05 13:03 (external edit)
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki