mirror of
https://github.com/e107inc/e107.git
synced 2025-08-29 17:19:56 +02:00
Shortcode tests for list_new, pm, rss_menu, signin and simpleParse()
This commit is contained in:
@@ -33,6 +33,8 @@ class listclass
|
||||
var $list_pref;
|
||||
var $mode;
|
||||
var $shortcodes = FALSE;
|
||||
private $pf; // profanity filter class.
|
||||
public $data;
|
||||
|
||||
/**
|
||||
* constructor
|
||||
@@ -180,7 +182,10 @@ class listclass
|
||||
$arr[$s]['amount'] = vartrue($this->list_pref[$s."_".$mode."_amount"]);
|
||||
$arr[$s]['order'] = vartrue($this->list_pref[$s."_".$mode."_order"]);
|
||||
$arr[$s]['section'] = $s;
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
//sort array on order values set in preferences
|
||||
usort($arr, function($e, $f)
|
||||
@@ -226,6 +231,8 @@ class listclass
|
||||
return;
|
||||
}
|
||||
|
||||
$content_name = '';
|
||||
|
||||
$content_types = array();
|
||||
|
||||
//get top level categories
|
||||
@@ -302,63 +309,63 @@ class listclass
|
||||
{
|
||||
if ($plugin_installed = isset($pref['plug_installed'][e107::getParser()->toDB($s, true)]))
|
||||
{
|
||||
$prf["$s_recent_menu_caption"] = $s;
|
||||
$prf["$s_recent_page_caption"] = $s;
|
||||
$prf["$s_new_menu_caption"] = $s;
|
||||
$prf["$s_new_page_caption"] = $s;
|
||||
$prf[$s."_recent_menu_caption"] = $s;
|
||||
$prf[$s."_recent_page_caption"] = $s;
|
||||
$prf[$s."_new_menu_caption"] = $s;
|
||||
$prf[$s."_new_page_caption"] = $s;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$prf["$s_recent_menu_caption"] = $this->titles[$i];
|
||||
$prf["$s_recent_page_caption"] = $this->titles[$i];
|
||||
$prf["$s_new_menu_caption"] = $this->titles[$i];
|
||||
$prf["$s_new_page_caption"] = $this->titles[$i];
|
||||
$prf[$s."_recent_menu_caption"] = $this->titles[$i];
|
||||
$prf[$s."_recent_page_caption"] = $this->titles[$i];
|
||||
$prf[$s."_new_menu_caption"] = $this->titles[$i];
|
||||
$prf[$s."_new_page_caption"] = $this->titles[$i];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$prf["$s_recent_menu_caption"] = $s;
|
||||
$prf["$s_recent_page_caption"] = $s;
|
||||
$prf["$s_new_menu_caption"] = $s;
|
||||
$prf["$s_new_page_caption"] = $s;
|
||||
$prf[$s."_recent_menu_caption"] = $s;
|
||||
$prf[$s."_recent_page_caption"] = $s;
|
||||
$prf[$s."_new_menu_caption"] = $s;
|
||||
$prf[$s."_new_page_caption"] = $s;
|
||||
}
|
||||
|
||||
$prf["$s_recent_menu_display"] = "1";
|
||||
$prf["$s_recent_menu_open"] = "0";
|
||||
$prf["$s_recent_menu_author"] = "0";
|
||||
$prf["$s_recent_menu_category"] = "0";
|
||||
$prf["$s_recent_menu_date"] = "1";
|
||||
$prf["$s_recent_menu_amount"] = "5";
|
||||
$prf["$s_recent_menu_order"] = ($i+1);
|
||||
$prf["$s_recent_menu_icon"] = '';
|
||||
$prf[$s."_recent_menu_display"] = "1";
|
||||
$prf[$s."_recent_menu_open"] = "0";
|
||||
$prf[$s."_recent_menu_author"] = "0";
|
||||
$prf[$s."_recent_menu_category"] = "0";
|
||||
$prf[$s."_recent_menu_date"] = "1";
|
||||
$prf[$s."_recent_menu_amount"] = "5";
|
||||
$prf[$s."_recent_menu_order"] = ($i+1);
|
||||
$prf[$s."_recent_menu_icon"] = '';
|
||||
|
||||
$prf["$s_recent_page_display"] = "1";
|
||||
$prf["$s_recent_page_open"] = "1";
|
||||
$prf["$s_recent_page_author"] = "1";
|
||||
$prf["$s_recent_page_category"] = "1";
|
||||
$prf["$s_recent_page_date"] = "1";
|
||||
$prf["$s_recent_page_amount"] = "10";
|
||||
$prf["$s_recent_page_order"] = ($i+1);
|
||||
$prf["$s_recent_page_icon"] = "1";
|
||||
$prf[$s."_recent_page_display"] = "1";
|
||||
$prf[$s."_recent_page_open"] = "1";
|
||||
$prf[$s."_recent_page_author"] = "1";
|
||||
$prf[$s."_recent_page_category"] = "1";
|
||||
$prf[$s."_recent_page_date"] = "1";
|
||||
$prf[$s."_recent_page_amount"] = "10";
|
||||
$prf[$s."_recent_page_order"] = ($i+1);
|
||||
$prf[$s."_recent_page_icon"] = "1";
|
||||
|
||||
$prf["$s_new_menu_display"] = "1";
|
||||
$prf["$s_new_menu_open"] = "0";
|
||||
$prf["$s_new_menu_author"] = "0";
|
||||
$prf["$s_new_menu_category"] = "0";
|
||||
$prf["$s_new_menu_date"] = "1";
|
||||
$prf["$s_new_menu_amount"] = "5";
|
||||
$prf["$s_new_menu_order"] = ($i+1);
|
||||
$prf["$s_new_menu_icon"] = "1";
|
||||
$prf[$s."_new_menu_display"] = "1";
|
||||
$prf[$s."_new_menu_open"] = "0";
|
||||
$prf[$s."_new_menu_author"] = "0";
|
||||
$prf[$s."_new_menu_category"] = "0";
|
||||
$prf[$s."_new_menu_date"] = "1";
|
||||
$prf[$s."_new_menu_amount"] = "5";
|
||||
$prf[$s."_new_menu_order"] = ($i+1);
|
||||
$prf[$s."_new_menu_icon"] = "1";
|
||||
|
||||
$prf["$s_new_page_display"] = "1";
|
||||
$prf["$s_new_page_open"] = "1";
|
||||
$prf["$s_new_page_author"] = "1";
|
||||
$prf["$s_new_page_category"] = "1";
|
||||
$prf["$s_new_page_date"] = "1";
|
||||
$prf["$s_new_page_amount"] = "10";
|
||||
$prf["$s_new_page_order"] = ($i+1);
|
||||
$prf["$s_new_page_icon"] = "1";
|
||||
$prf[$s."_new_page_display"] = "1";
|
||||
$prf[$s."_new_page_open"] = "1";
|
||||
$prf[$s."_new_page_author"] = "1";
|
||||
$prf[$s."_new_page_category"] = "1";
|
||||
$prf[$s."_new_page_date"] = "1";
|
||||
$prf[$s."_new_page_amount"] = "10";
|
||||
$prf[$s."_new_page_order"] = ($i+1);
|
||||
$prf[$s."_new_page_icon"] = "1";
|
||||
}
|
||||
|
||||
//new menu preferences
|
||||
@@ -583,16 +590,15 @@ class listclass
|
||||
if (e107::getPref('profanity_filter'))
|
||||
{
|
||||
$tp = e107::getParser();
|
||||
if (!is_object($parser->e_pf))
|
||||
if (!is_object($this->pf))
|
||||
{
|
||||
// require_once(e_HANDLER.'profanity_filter.php');
|
||||
$parser->e_pf = new e_profanityFilter;
|
||||
$this->pf = new e_profanityFilter;
|
||||
}
|
||||
foreach ($listArray as $k => $v)
|
||||
{
|
||||
if (isset($v['heading']))
|
||||
{
|
||||
$listArray[$k]['heading'] = $tp->e_pf->filterProfanities($v['heading']);
|
||||
$listArray[$k]['heading'] = $this->pf->filterProfanities($v['heading']);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -781,6 +787,8 @@ class listclass
|
||||
{
|
||||
global $qs;
|
||||
|
||||
$text = '';
|
||||
|
||||
//get preferences
|
||||
if(!isset($this->list_pref))
|
||||
{
|
||||
|
@@ -24,18 +24,12 @@ if (!defined('e107_INIT')) { exit; }
|
||||
|
||||
class list_shortcodes
|
||||
{
|
||||
var $rc;
|
||||
var $rc; // list class.
|
||||
var $e107;
|
||||
var $row;
|
||||
var $list_pref;
|
||||
var $list_pref = array();
|
||||
public $plugin;
|
||||
|
||||
function __construct()
|
||||
{
|
||||
$this->e107 = e107::getInstance();
|
||||
$this->rc = '';
|
||||
}
|
||||
|
||||
/*
|
||||
function load_globals()
|
||||
{
|
||||
@@ -90,37 +84,63 @@ class list_shortcodes
|
||||
|
||||
function sc_list_info()
|
||||
{
|
||||
if(empty($this->row['info']))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return e107::getParser()->toHTML($this->row['info'], true, "");
|
||||
}
|
||||
|
||||
function sc_list_caption()
|
||||
{
|
||||
if(empty($this->rc->data) || empty($this->rc->data['caption']))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return e107::getParser()->toHTML($this->rc->data['caption'], true, "");
|
||||
}
|
||||
|
||||
function sc_list_displaystyle()
|
||||
{
|
||||
//open sections if content exists ? yes if true, else use individual setting of section
|
||||
return (vartrue($this->list_pref[$this->rc->mode."_openifrecords"]) && is_array($this->rc->data['records']) ? "" : $this->rc->data['display']);
|
||||
$mode = $this->rc->mode."_openifrecords";
|
||||
return (!empty($this->list_pref[$mode]) && isset($this->rc->data['records']) && is_array($this->rc->data['records'])) ? "" : varset($this->rc->data['display']);
|
||||
}
|
||||
|
||||
function sc_list_col_cols()
|
||||
{
|
||||
if(empty($this->list_pref[$this->rc->mode."_colomn"]))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return $this->list_pref[$this->rc->mode."_colomn"];
|
||||
}
|
||||
|
||||
function sc_list_col_welcometext()
|
||||
{
|
||||
if(empty($this->list_pref[$this->rc->mode."_welcometext"]))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return e107::getParser()->toHTML($this->list_pref[$this->rc->mode."_welcometext"], true, "");
|
||||
}
|
||||
|
||||
function sc_list_col_cellwidth()
|
||||
{
|
||||
if(empty($this->list_pref[$this->rc->mode."_colomn"]))
|
||||
{
|
||||
return 25;
|
||||
}
|
||||
|
||||
return round((100/$this->list_pref[$this->rc->mode."_colomn"]),0);
|
||||
}
|
||||
|
||||
function sc_list_timelapse()
|
||||
{
|
||||
return $this->row['timelapse'];
|
||||
return varset($this->row['timelapse']);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user