function changeTpl($tpl, $type = SKINNED)
{
- $this->_tpl = $tpl;
- $this->_page_type = $type;
- $this->assign('xorg_tpl', $tpl);
+ $this->_tpl = $tpl;
+ $this->_page_type = $type;
+ $this->assign('xorg_tpl', $tpl);
}
// }}}
$this->assign('xorg_failure', $this->_failure);
$this->assign('globals', $globals);
+ if (Env::v('display') == 'light') {
+ $this->_page_type = SIMPLE;
+ } elseif (Env::v('display') == 'raw') {
+ $this->_page_type = NO_SKIN;
+ } elseif (Env::v('display') == 'full') {
+ $this->_page_typ = SKINNED;
+ }
+
switch ($this->_page_type) {
case NO_SKIN:
error_reporting(0);
}
// }}}
+ // {{{ function addCssInline
+
+ function addCssInline($css)
+ {
+ if (!empty($css)) {
+ $this->append('xorg_inline_css', $css);
+ }
+ }
+
+ // }}}
// {{{ function setRssLink
function setRssLink($title, $path)
function hide_emails($source, &$smarty)
{
+ fix_encoding($source);
+
//prevent email replacement in <script> and <textarea>
$tags = array('script', 'textarea', 'select');
}
//catch all emails in <a href="mailto:...">
- preg_match_all("!<a[^>]+href=[\"'][^\"']*[-a-z0-9_.]+@[-a-z0-9_.]+[^\"']*[\"'][^>]*>.*?</a>!is", $source, $ahref);
- $source = preg_replace("!<a[^>]+href=[\"'][^\"']*[-a-z0-9_.]+@[-a-z0-9_.]+[^\"']*[\"'][^>]*>.*?</a>!is", '&&&ahref&&&', $source);
+ preg_match_all("!<a[^>]+href=[\"'][^\"']*[-a-z0-9+_.]+@[-a-z0-9_.]+[^\"']*[\"'][^>]*>.*?</a>!is", $source, $ahref);
+ $source = preg_replace("!<a[^>]+href=[\"'][^\"']*[-a-z0-9+_.]+@[-a-z0-9_.]+[^\"']*[\"'][^>]*>.*?</a>!is", '&&&ahref&&&', $source);
//prevant replacement in tag attributes
- preg_match_all("!<[^>]+[-a-z0-9_.]+@[-a-z0-9_.]+[^>]+>!is", $source, $misc);
- $source = preg_replace("!<[^>]+[-a-z0-9_.]+@[-a-z0-9_.]+[^>]+>!is", '&&&misc&&&', $source);
+ preg_match_all("!<[^>]+[-a-z0-9_+.]+@[-a-z0-9_.]+[^>]+>!is", $source, $misc);
+ $source = preg_replace("!<[^>]+[-a-z0-9_+.]+@[-a-z0-9_.]+[^>]+>!is", '&&&misc&&&', $source);
//catch !
- $source = preg_replace('!([-a-z0-9_.]+@[-a-z0-9_.]+)!ie', '_hide_email("\1")', $source);
+ $source = preg_replace('!([-a-z0-9_+.]+@[-a-z0-9_.]+)!ie', '_hide_email("\1")', $source);
$source = preg_replace('!&&&ahref&&&!e', '_hide_email(array_shift($ahref[0]))', $source);
// restore data