mirror of
https://github.com/e107inc/e107.git
synced 2025-08-05 06:07:32 +02:00
Fixes #1457 New Forum Posts Menu - "Show Original Topic in Menu" option not saving. New User-Extended Field preset for User comments. New e107::debug() function added for throwing info to the browser console. (Firefox/Chrome)
This commit is contained in:
@@ -117,7 +117,14 @@ TEMPL;
|
||||
// alert(target);
|
||||
$.post(target, data ,function(ret)
|
||||
{
|
||||
// alert('Posted: '+ret);
|
||||
// alert('Posted: '+ret);
|
||||
// console.log('Posted: '+ ret);
|
||||
|
||||
if(ret == '')
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
var a = $.parseJSON(ret);
|
||||
|
||||
if(a.error)
|
||||
|
@@ -77,6 +77,13 @@
|
||||
<applicable>253</applicable>
|
||||
<read>253</read>
|
||||
<write>253</write>
|
||||
</item>
|
||||
<item name="comment">
|
||||
<type>textarea</type>
|
||||
<include_text>class='form-control tbox' col='80' maxlength='254'</include_text>
|
||||
<applicable>253</applicable>
|
||||
<read>253</read>
|
||||
<write>253</write>
|
||||
</item>
|
||||
<item name="timezone">
|
||||
<type>list</type>
|
||||
|
@@ -484,10 +484,14 @@ class e_array {
|
||||
if (!is_array($ArrayData)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$Array = var_export($ArrayData, true);
|
||||
if ($AddSlashes == true) {
|
||||
|
||||
if ($AddSlashes == true)
|
||||
{
|
||||
$Array = addslashes($Array);
|
||||
}
|
||||
|
||||
return $Array;
|
||||
}
|
||||
|
||||
|
@@ -1863,6 +1863,99 @@ class e107
|
||||
$jshandler->resetDependency();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Throw log/info/warnings/errors to the Chrome/Firefox Console.
|
||||
* @param $name
|
||||
* @param null $var
|
||||
* @param string $type
|
||||
*/
|
||||
public static function debug($name, $var = null, $type = 'log', $js = false)
|
||||
{
|
||||
|
||||
$nl = "\r\n";
|
||||
// echo "alert('hi');";
|
||||
|
||||
if($js != true)
|
||||
{
|
||||
echo '<script type="text/javascript">'.$nl;
|
||||
}
|
||||
|
||||
switch($type) {
|
||||
case 'log':
|
||||
echo 'console.log("'.$name.'");'.$nl;
|
||||
break;
|
||||
case 'info':
|
||||
echo 'console.info("'.$name.'");'.$nl;
|
||||
break;
|
||||
case 'warning':
|
||||
echo 'console.warn("'.$name.'");'.$nl;
|
||||
break;
|
||||
case 'error':
|
||||
echo 'console.error("'.$name.'");'.$nl;
|
||||
break;
|
||||
}
|
||||
|
||||
if (!empty($var))
|
||||
{
|
||||
if (is_object($var) || is_array($var))
|
||||
{
|
||||
$object = json_encode($var);
|
||||
|
||||
echo 'var object'.preg_replace('~[^A-Z|0-9]~i',"_",$name).' = \''.str_replace("'","\'",$object).'\';'.$nl;
|
||||
echo 'var val'.preg_replace('~[^A-Z|0-9]~i',"_",$name).' = eval("(" + object'.preg_replace('~[^A-Z|0-9]~i',"_",$name).' + ")" );'.$nl;
|
||||
|
||||
switch($type)
|
||||
{
|
||||
case 'log':
|
||||
echo 'console.debug(val'.preg_replace('~[^A-Z|0-9]~i',"_",$name).');'.$nl;
|
||||
break;
|
||||
case 'info':
|
||||
echo 'console.info(val'.preg_replace('~[^A-Z|0-9]~i',"_",$name).');'.$nl;
|
||||
break;
|
||||
case 'warning':
|
||||
echo 'console.warn(val'.preg_replace('~[^A-Z|0-9]~i',"_",$name).');'.$nl;
|
||||
break;
|
||||
case 'error':
|
||||
echo 'console.error(val'.preg_replace('~[^A-Z|0-9]~i',"_",$name).');'.$nl;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
switch($type)
|
||||
{
|
||||
case 'log':
|
||||
echo 'console.debug("'.str_replace('"','\\"',$var).'");'.$nl;
|
||||
break;
|
||||
case 'info':
|
||||
echo 'console.info("'.str_replace('"','\\"',$var).'");'.$nl;
|
||||
break;
|
||||
case 'warning':
|
||||
echo 'console.warn("'.str_replace('"','\\"',$var).'");'.$nl;
|
||||
break;
|
||||
case 'error':
|
||||
echo 'console.error("'.str_replace('"','\\"',$var).'");'.$nl;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if($js != true)
|
||||
{
|
||||
echo '</script>'.$nl;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Retrieve JS Helper object
|
||||
*
|
||||
|
@@ -1666,6 +1666,8 @@ class e_form
|
||||
$text .= "<span>".$labelFound."</span></label>";
|
||||
}
|
||||
|
||||
|
||||
|
||||
return $text;
|
||||
}
|
||||
|
||||
@@ -1684,6 +1686,12 @@ class e_form
|
||||
$options_on = varset($options['enabled'],array());
|
||||
$options_off = varset($options['disabled'],array());
|
||||
|
||||
unset($options['enabled'],$options['disabled']);
|
||||
|
||||
$options_on = array_merge($options_on, $options);
|
||||
$options_off = array_merge($options_off, $options);
|
||||
|
||||
|
||||
if(vartrue($options['class']) == 'e-expandit' || vartrue($options['expandit'])) // See admin->prefs 'Single Login' for an example.
|
||||
{
|
||||
$options_on = array_merge($options, array('class' => 'e-expandit-on'));
|
||||
@@ -1708,6 +1716,8 @@ class e_form
|
||||
$text = $this->radio($name, 1, $checked_enabled, $options_on)." ".$this->radio($name, 0, !$checked_enabled, $options_off);
|
||||
}
|
||||
|
||||
|
||||
|
||||
return $text;
|
||||
|
||||
}
|
||||
@@ -2639,6 +2649,7 @@ class e_form
|
||||
|
||||
case 'radio':
|
||||
//$def_options['class'] = ' ';
|
||||
$def_options = array('class' => '');
|
||||
unset($def_options['size'], $def_options['selected']);
|
||||
break;
|
||||
|
||||
|
@@ -56,6 +56,8 @@ define("UE_LAN_GENDER","Gender");
|
||||
define("UE_LAN_GENDER_DESC","Gender");
|
||||
define("UE_LAN_MALE","Male");
|
||||
define("UE_LAN_FEMALE","Female");
|
||||
define("UE_LAN_COMMENT", "Comments");
|
||||
define("UE_LAN_COMMENT_DESC", "Comment Box");
|
||||
|
||||
|
||||
|
||||
|
@@ -38,7 +38,7 @@ class forum_newforumposts_menu // plugin folder + menu name (without the .php)
|
||||
function getQuery()
|
||||
{
|
||||
$max_age = vartrue($this->menuPref['maxage'], 0);
|
||||
$max_age = ($max_age == 0) ? '' : '(t.post_datestamp > '.(time()-(int)$max_age*86400).') AND ';
|
||||
$max_age = ($max_age == 0) ? '' : '(p.post_datestamp > '.(time()-(int)$max_age*86400).') AND ';
|
||||
|
||||
$forumList = implode(',', $this->forumObj->getForumPermList('view'));
|
||||
|
||||
@@ -148,6 +148,8 @@ class forum_newforumposts_menu // plugin folder + menu name (without the .php)
|
||||
$caption = LAN_PLUGIN_FORUM_LATESTPOSTS;
|
||||
}
|
||||
|
||||
// e107::debug('menuPref', $this->menuPref);
|
||||
|
||||
e107::getRender()->tablerender($caption, $text, 'nfp_menu');
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user