Example #1
0
 public function __construct($appendCustomTags = true)
 {
     parent::__construct($appendCustomTags);
     // change all unparsable tags to use the unparsable callback
     // [img] and [attach] tags are not parsed via the normal parser
     foreach ($this->tag_list['option'] as $tagname => $info) {
         if (isset($this->tag_list['option']["{$tagname}"])) {
             $this->tag_list['option']["{$tagname}"]['callback'] = 'handle_unparsable';
             unset($this->tag_list['option']["{$tagname}"]['html']);
         }
     }
     foreach ($this->tag_list['no_option'] as $tagname => $info) {
         if (isset($this->tag_list['no_option']["{$tagname}"])) {
             $this->tag_list['no_option']["{$tagname}"]['callback'] = 'handle_unparsable';
             unset($this->tag_list['no_option']["{$tagname}"]['html']);
         }
     }
 }
Example #2
0
 public function __construct($appendCustomTags = true)
 {
     $this->setStripSpace(false);
     parent::__construct($appendCustomTags);
     if (!empty(self::$customTags['no_option'])) {
         foreach (self::$customTags['no_option'] as $tagname => $taginfo) {
             if (!isset($this->unparsed_tags[$tagname])) {
                 $this->unparsed_tags[$tagname] = $tagname;
             }
         }
     }
     if (!empty(self::$customTags['option'])) {
         foreach (self::$customTags['option'] as $tagname => $taginfo) {
             if (!isset($this->unparsed_tags[$tagname])) {
                 $this->unparsed_tags[$tagname] = $tagname;
             }
         }
     }
     // change all unparsable tags to use the unparsable callback
     foreach ($this->unparsed_tags as $remove) {
         if (isset($this->tag_list['option']["{$remove}"])) {
             $this->tag_list['option']["{$remove}"]['callback'] = 'handle_wysiwyg_unparsable';
             unset($this->tag_list['option']["{$remove}"]['html'], $this->tag_list['option']["{$remove}"]['strip_space_after']);
         }
         if (isset($this->tag_list['no_option']["{$remove}"])) {
             $this->tag_list['no_option']["{$remove}"]['callback'] = 'handle_wysiwyg_unparsable';
             unset($this->tag_list['no_option']["{$remove}"]['html'], $this->tag_list['option']["{$remove}"]['strip_space_after']);
         }
     }
     // make the "pre" tags use the correct handler
     foreach (array('code', 'php', 'html') as $pre_tag) {
         if (isset($this->tag_list['no_option']["{$pre_tag}"])) {
             $this->tag_list['no_option']["{$pre_tag}"]['callback'] = 'handle_preformatted_tag';
             unset($this->tag_list['no_option']["{$pre_tag}"]['html'], $this->tag_list['option']["{$pre_tag}"]['strip_space_after']);
         }
     }
     $this->type = vB5_Template_Runtime::isBrowser('ie') ? 'ie' : 'moz_css';
 }