mirror of
https://github.com/e107inc/e107.git
synced 2025-08-13 18:14:26 +02:00
Merged upstream repository changes into this fork.
This commit is contained in:
24
class2.php
24
class2.php
@@ -908,6 +908,7 @@ if (!class_exists('e107table', false))
|
||||
private $themeClass = '';
|
||||
private $adminThemeClass = '';
|
||||
public $frontend = null;
|
||||
private $uniqueId = null;
|
||||
|
||||
|
||||
function __construct()
|
||||
@@ -918,13 +919,23 @@ if (!class_exists('e107table', false))
|
||||
|
||||
|
||||
/**
|
||||
* @param $style
|
||||
* Set the style mode for use in tablestyle() method/function
|
||||
* @param string $style
|
||||
*/
|
||||
function setStyle($style)
|
||||
public function setStyle($style)
|
||||
{
|
||||
$this->eSetStyle = $style;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set a unique id for use in tablestyle() method/function
|
||||
* @param string $id
|
||||
*/
|
||||
public function setUniqueId($id)
|
||||
{
|
||||
$this->uniqueId = $id;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param $caption string caption text
|
||||
@@ -948,6 +959,10 @@ if (!class_exists('e107table', false))
|
||||
extract($result);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if ($return)
|
||||
{
|
||||
if(!empty($text) && $this->eMenuArea)
|
||||
@@ -998,13 +1013,14 @@ if (!class_exists('e107table', false))
|
||||
|
||||
if(is_object(vartrue($thm)))
|
||||
{
|
||||
$thm->tablestyle($caption, $text, $mode, array('menuArea'=>$this->eMenuArea, 'menuCount'=>$this->eMenuCount, 'menuTotal'=>varset($this->eMenuTotal[$this->eMenuArea]), 'setStyle'=>$this->eSetStyle));
|
||||
$thm->tablestyle($caption, $text, $mode, array('uniqueId'=>$this->uniqueId, 'menuArea'=>$this->eMenuArea, 'menuCount'=>$this->eMenuCount, 'menuTotal'=>varset($this->eMenuTotal[$this->eMenuArea]), 'setStyle'=>$this->eSetStyle));
|
||||
}
|
||||
else
|
||||
{
|
||||
tablestyle($caption, $text, $mode, array('menuArea'=>$this->eMenuArea,'menuCount'=>$this->eMenuCount,'menuTotal'=>varset($this->eMenuTotal[$this->eMenuArea]),'setStyle'=>$this->eSetStyle));
|
||||
tablestyle($caption, $text, $mode, array('uniqueId'=>$this->uniqueId, 'menuArea'=>$this->eMenuArea,'menuCount'=>$this->eMenuCount,'menuTotal'=>varset($this->eMenuTotal[$this->eMenuArea]),'setStyle'=>$this->eSetStyle));
|
||||
}
|
||||
|
||||
$this->uniqueId = null;
|
||||
}
|
||||
|
||||
|
||||
|
@@ -440,7 +440,7 @@ class page_admin_ui extends e_admin_ui
|
||||
LEFT JOIN #user AS u ON p.page_author = u.user_id
|
||||
LEFT JOIN #page_chapters AS pch ON p.page_chapter = pch.chapter_id
|
||||
LEFT JOIN #page_chapters AS pbk ON pch.chapter_parent = pbk.chapter_id
|
||||
WHERE p.page_title != '' "; // without any Order or Limit.
|
||||
WHERE (p.page_title != '' OR p.page_text != '') "; // without any Order or Limit.
|
||||
//protected $editQry = "SELECT * FROM #comments WHERE comment_id = {ID}";
|
||||
|
||||
protected $pid = "page_id";
|
||||
|
@@ -23,6 +23,502 @@ if (!getperms('O'))
|
||||
}
|
||||
|
||||
include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_'.e_PAGE);
|
||||
|
||||
|
||||
|
||||
class plugin_notify_admin extends e_admin_dispatcher
|
||||
{
|
||||
|
||||
protected $modes = array(
|
||||
'main' => array('controller' => 'plugin_notify_admin_ui',
|
||||
'path' => null,
|
||||
'ui' => 'plugin_notify_admin_form_ui', 'uipath' => null)
|
||||
);
|
||||
|
||||
protected $adminMenu = array(
|
||||
'main/config' => array('caption'=> "Email", 'perm' => '0'),
|
||||
'main/push' => array('caption'=> "Push (experimental)", 'perm' => '0')
|
||||
);
|
||||
|
||||
protected $adminMenuAliases = array(
|
||||
'main/edit' => 'main/list'
|
||||
);
|
||||
|
||||
/**
|
||||
* Navigation menu title
|
||||
* @var string
|
||||
*/
|
||||
protected $menuTitle = NT_LAN_1;
|
||||
|
||||
function init()
|
||||
{
|
||||
if(e_DEBUG !== true)
|
||||
{
|
||||
unset($this->adminMenu['main/push']);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
class plugin_notify_admin_ui extends e_admin_ui
|
||||
{
|
||||
protected $pluginTitle = NT_LAN_1;
|
||||
|
||||
protected $pluginName = 'core';
|
||||
|
||||
protected $table = "";
|
||||
|
||||
protected $listQry = "";
|
||||
|
||||
protected $pid = "notify_id";
|
||||
|
||||
protected $perPage = 20;
|
||||
|
||||
protected $batchDelete = true;
|
||||
|
||||
// protected $displaySettings = array();
|
||||
|
||||
// protected $disallowPages = array('main/create', 'main/prefs');
|
||||
|
||||
|
||||
protected $fields = array();
|
||||
|
||||
//required - default column user prefs
|
||||
protected $fieldpref = array();
|
||||
|
||||
|
||||
// optional, if $pluginName == 'core', core prefs will be used, else e107::getPluginConfig($pluginName);
|
||||
protected $prefs = array(
|
||||
/* 'pref_type' => array('title'=> 'type', 'type'=>'text', 'data' => 'string', 'validate' => true),
|
||||
'pref_folder' => array('title'=> 'folder', 'type' => 'boolean', 'data' => 'integer'),
|
||||
'pref_name' => array('title'=> 'name', 'type' => 'text', 'data' => 'string', 'validate' => 'regex', 'rule' => '#^[\w]+$#i', 'help' => 'allowed characters are a-zA-Z and underscore')*/
|
||||
);
|
||||
|
||||
var $notify_prefs;
|
||||
var $changeList = array();
|
||||
var $pluginConfig = array();
|
||||
|
||||
function init()
|
||||
{
|
||||
|
||||
|
||||
if(!empty($_POST['update']))
|
||||
{
|
||||
if($this-> update())
|
||||
{
|
||||
// e107::getMessage()->addSuccess(LAN_UPDATED);
|
||||
}
|
||||
else
|
||||
{
|
||||
e107::getMessage()->addError(LAN_UPDATED_FAILED);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
$pref = e107::getPref();
|
||||
$this->notify_prefs = e107::getConfig('notify')->getPref();
|
||||
|
||||
$this->prefCleanup();
|
||||
$this->test();
|
||||
|
||||
$recalibrate = FALSE;
|
||||
|
||||
// load every e_notify.php file.
|
||||
if($pref['e_notify_list'])
|
||||
{
|
||||
foreach($pref['e_notify_list'] as $val) // List of available e_notify.php files.
|
||||
{
|
||||
// if (!isset($this->notify_prefs['plugins'][$val]))
|
||||
{
|
||||
|
||||
$this -> notify_prefs['plugins'][$val] = TRUE;
|
||||
|
||||
if (is_readable(e_PLUGIN.$val."/e_notify.php"))
|
||||
{
|
||||
require_once(e_PLUGIN.$val.'/e_notify.php');
|
||||
|
||||
if(class_exists($val."_notify")) // new v2.x
|
||||
{
|
||||
$legacy = 0; // Newe.
|
||||
$config_events = array();
|
||||
|
||||
$data = e107::callMethod($val."_notify", 'config');
|
||||
|
||||
$config_category = str_replace("_menu","",ucfirst($val))." Events";
|
||||
|
||||
foreach($data as $v)
|
||||
{
|
||||
$func = $v['function'];
|
||||
$config_events[$func] = $v['name'];
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
$legacy = 1; // Legacy Mode.
|
||||
}
|
||||
|
||||
// foreach ($config_events as $event_id => $event_text)
|
||||
// {
|
||||
// $this -> notify_prefs['event'][$event_id] = array('class' => '255', 'email' => '', 'plugin'=> $val);
|
||||
|
||||
// }
|
||||
$this->pluginConfig[$val] = array('category' => $config_category, 'events' => $config_events, 'legacy'=> $legacy);
|
||||
$recalibrate = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// print_a($this->pluginConfig);
|
||||
|
||||
if ($recalibrate)
|
||||
{
|
||||
// $s_prefs = $tp -> toDB($this -> notify_prefs);
|
||||
// $s_prefs = $eArrayStorage -> WriteArray($s_prefs);
|
||||
// $sql -> db_Update("core", "e107_value='".$s_prefs."' WHERE e107_name='notify_prefs'");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
function prefCleanup()
|
||||
{
|
||||
$oldPrefs = e107::getEvent()->oldCoreList();
|
||||
$curData = $this->notify_prefs['event'];
|
||||
|
||||
foreach($curData as $k=>$v)
|
||||
{
|
||||
if(isset($oldPrefs[$k]))
|
||||
{
|
||||
$newKey = $oldPrefs[$k];
|
||||
$this->notify_prefs['event'][$newKey] = $v;
|
||||
unset($this->notify_prefs['event'][$k]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
function pushPage()
|
||||
{
|
||||
|
||||
e107::getMessage()->addInfo("Under Construction");
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
function test()
|
||||
{
|
||||
if(!empty($_POST['test']))
|
||||
{
|
||||
$id = key( $_POST['test']);
|
||||
$exampleData = array('id'=>'Test for '.$id, 'data'=>'example data' );
|
||||
e107::getMessage()->addSuccess('Triggering: '.$id);
|
||||
e107::getEvent()->trigger($id, $exampleData);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
function configPage()
|
||||
{
|
||||
//global $ns, $rs, $frm, $emessage;
|
||||
$ns = e107::getRender();
|
||||
$frm = e107::getForm();
|
||||
$mes = e107::getMessage();
|
||||
|
||||
|
||||
$events = e107::getEvent()->coreList();
|
||||
$tab = array();
|
||||
|
||||
foreach($events as $k=>$cat)
|
||||
{
|
||||
$text = " <table class='table adminform'>
|
||||
<colgroup>
|
||||
<col class='col-label' />
|
||||
<col class='col-control' />
|
||||
</colgroup>";
|
||||
|
||||
foreach($cat as $c=>$ev)
|
||||
{
|
||||
$text .= $this -> render_event($c, $ev);
|
||||
}
|
||||
$text .= "</table>";
|
||||
|
||||
$caption = str_replace("_menu","",ucfirst($k))." ".LAN_NOTIFY_01;
|
||||
|
||||
$tab[] = array('caption'=>$caption, 'text' => $text);
|
||||
}
|
||||
|
||||
if(!empty($this->notify_prefs['plugins']))
|
||||
{
|
||||
|
||||
foreach ($this->notify_prefs['plugins'] as $plugin_id => $plugin_settings)
|
||||
{
|
||||
if(is_readable(e_PLUGIN.$plugin_id.'/e_notify.php'))
|
||||
{
|
||||
$config_category = $this->pluginConfig[$plugin_id]['category'];
|
||||
$legacy = $this->pluginConfig[$plugin_id]['legacy'];
|
||||
|
||||
$text = "<table class='table adminform'>
|
||||
<colgroup>
|
||||
<col class='col-label' />
|
||||
<col class='col-control' />
|
||||
</colgroup>";
|
||||
;
|
||||
|
||||
foreach ($this->pluginConfig[$plugin_id]['events'] as $event_id => $event_text)
|
||||
{
|
||||
$text .= $this->render_event($event_id, $event_text, $plugin_id, $legacy);
|
||||
}
|
||||
|
||||
$text .= "</table>\n";
|
||||
|
||||
$tab[] = array('caption'=> $config_category, 'text'=> $text);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
$text2 = $frm->open('scanform', 'post', e_REQUEST_URL); // <form action='".e_SELF."?results' method='post' id='scanform'>
|
||||
$text2 .= $frm->tabs($tab);
|
||||
$text2 .= "<div class='buttons-bar center'>". $frm->admin_button('update', LAN_UPDATE,'update') . "</div>";
|
||||
$text2 .= $frm->close();
|
||||
|
||||
|
||||
// $ns -> tablerender(NT_LAN_1, $mes->render() . $text2);
|
||||
|
||||
return $text2;
|
||||
// return;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
function render_event($id, $description, $include='', $legacy = 0)
|
||||
{
|
||||
$tp = e107::getParser();
|
||||
$frm = e107::getForm();
|
||||
$uc = e107::getUserClass();
|
||||
$uc->fixed_classes['email'] = 'Email Address =>';
|
||||
$uc->text_class_link['email'] = 'email';
|
||||
|
||||
|
||||
if(defined($description))
|
||||
{
|
||||
$description = constant($description);
|
||||
}
|
||||
|
||||
|
||||
|
||||
$highlight = varset($_GET['type']) == $id ? " class='text-warning'" : '';
|
||||
|
||||
$text = "
|
||||
<tr>
|
||||
<td title='".$id."'><span{$highlight}>".$description.":</span></td>";
|
||||
|
||||
|
||||
|
||||
if(e_DEBUG)
|
||||
{
|
||||
$text .= "<td>".$id."</td>";
|
||||
}
|
||||
|
||||
$text .= "
|
||||
<td class='form-inline nowrap'>
|
||||
".$uc->uc_dropdown('event['.$id.'][class]', varset($this->notify_prefs['event'][$id]['class'], e_UC_NOBODY), "nobody,main,admin,member,classes,email","onchange=\"mail_field(this.value,'event_".$id."');\" ");
|
||||
|
||||
if($this -> notify_prefs['event'][$id]['class'] == 'email')
|
||||
{
|
||||
$disp='display:visible';
|
||||
$value = $tp -> toForm($this -> notify_prefs['event'][$id]['email']);
|
||||
}
|
||||
else
|
||||
{
|
||||
$disp = "display:none";
|
||||
$value= "";
|
||||
}
|
||||
|
||||
$text .= "<input type='text' style='width:200px;$disp' class='tbox' id='event_".$id."' name='event[".$id."][email]' value=\"".$value."\" />\n";
|
||||
|
||||
$text .= $frm->hidden("event[".$id."][include]", $include);
|
||||
$text .= $frm->hidden("event[".$id."][legacy]", $legacy); // function or method
|
||||
|
||||
if(isset($this->notify_prefs['event'][$id]['class']) && $this->notify_prefs['event'][$id]['class'] != e_UC_NOBODY)
|
||||
{
|
||||
$text .= $frm->button('test['.$id.']', $id, 'confirm', 'Test');
|
||||
}
|
||||
|
||||
|
||||
$text .= "</td>";
|
||||
|
||||
|
||||
|
||||
|
||||
$text .= "
|
||||
</tr>";
|
||||
return $text;
|
||||
}
|
||||
|
||||
|
||||
function update()
|
||||
{
|
||||
$this->changeList = array();
|
||||
|
||||
$active = false;
|
||||
|
||||
foreach ($_POST['event'] as $key => $value)
|
||||
{
|
||||
if ($this -> update_event($key))
|
||||
{
|
||||
$active = true;
|
||||
}
|
||||
}
|
||||
|
||||
// print_a($this->notify_prefs);
|
||||
/*
|
||||
$s_prefs = $tp -> toDB($this -> notify_prefs);
|
||||
$s_prefs = $eArrayStorage -> WriteArray($s_prefs);
|
||||
if($sql -> db_Update("core", "e107_value='".$s_prefs."' WHERE e107_name='notify_prefs'")!==FALSE)
|
||||
*/
|
||||
|
||||
e107::getConfig()->set('notify',$active)->save(true,true,false);
|
||||
e107::getConfig('notify')->updatePref($this->notify_prefs);
|
||||
if (e107::getConfig('notify')->save(FALSE))
|
||||
{
|
||||
// e107::getAdminLog()->logArrayAll('NOTIFY_01',$this->changeList);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
function update_event($id)
|
||||
{
|
||||
$changed = FALSE;
|
||||
|
||||
if ($this -> notify_prefs['event'][$id]['class'] != $_POST['event'][$id]['class'])
|
||||
{
|
||||
$this -> notify_prefs['event'][$id]['class'] = $_POST['event'][$id]['class'];
|
||||
$changed = TRUE;
|
||||
}
|
||||
if ($this -> notify_prefs['event'][$id]['email'] != $_POST['event'][$id]['email'])
|
||||
{
|
||||
$this -> notify_prefs['event'][$id]['email'] = $_POST['event'][$id]['email'];
|
||||
$changed = TRUE;
|
||||
}
|
||||
|
||||
$this -> notify_prefs['event'][$id]['include'] = $_POST['event'][$id]['include'];
|
||||
$this -> notify_prefs['event'][$id]['legacy'] = $_POST['event'][$id]['legacy'];
|
||||
|
||||
unset($this -> notify_prefs['event'][$id]['plugin']);
|
||||
unset($this -> notify_prefs['event'][$id]['type']);
|
||||
|
||||
if ($changed)
|
||||
{
|
||||
$this->changeList[$id] = $this->notify_prefs['event'][$id]['class'].', '.$this->notify_prefs['event'][$id]['email'];
|
||||
}
|
||||
if ($this -> notify_prefs['event'][$id]['class'] != 255)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class plugin_notify_admin_form_ui extends e_admin_form_ui
|
||||
{
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
new plugin_notify_admin();
|
||||
|
||||
|
||||
require_once(e_ADMIN."auth.php");
|
||||
|
||||
e107::getAdminUI()->runPage();
|
||||
|
||||
require_once(e_ADMIN."footer.php");
|
||||
|
||||
function headerjs()
|
||||
{
|
||||
|
||||
$js = "
|
||||
<script type='text/javascript'>
|
||||
|
||||
function mail_field(val,id)
|
||||
{
|
||||
if(val == 'email')
|
||||
{
|
||||
document.getElementById(id).style.display ='';
|
||||
}
|
||||
else
|
||||
{
|
||||
document.getElementById(id).style.display ='none';
|
||||
}
|
||||
}
|
||||
|
||||
</script>";
|
||||
|
||||
return $js;
|
||||
}
|
||||
|
||||
exit;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$e_sub_cat = 'notify';
|
||||
|
||||
@@ -534,7 +1030,7 @@ class notify_config
|
||||
}
|
||||
}
|
||||
|
||||
require_once(e_ADMIN.'footer.php');
|
||||
require_once(e_ADMIN.'footer.php');/*
|
||||
function headerjs()
|
||||
{
|
||||
|
||||
@@ -556,5 +1052,5 @@ function headerjs()
|
||||
</script>";
|
||||
|
||||
return $js;
|
||||
}
|
||||
}*/
|
||||
?>
|
||||
|
@@ -494,6 +494,12 @@ else
|
||||
foreach ($search_prefs['comments_handlers'] as $key => $value)
|
||||
{
|
||||
$path = ($value['dir'] == 'core') ? e_HANDLER.'search/comments_'.$key.'.php' : e_PLUGIN.$value['dir'].'/search/search_comments.php';
|
||||
|
||||
if($value['dir'] == 'download' && !e107::isInstalled($value['dir']))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if(is_readable($path))
|
||||
{
|
||||
require_once($path);
|
||||
|
@@ -506,9 +506,8 @@ class admin_shortcodes
|
||||
|
||||
|
||||
// $text .= "</div>";
|
||||
|
||||
return ($parm != 'norender') ? $ns -> tablerender(ADLAN_LAT_1, $text, 'core-menu-latest', TRUE) : $text;
|
||||
|
||||
$ns->setUniqueId('e-latest-list');
|
||||
return ($parm != 'norender') ? $ns -> tablerender(ADLAN_LAT_1, $text, '', TRUE) : $text;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -982,6 +981,7 @@ class admin_shortcodes
|
||||
if ($pref['adminpwordchange'] && ((ADMINPWCHANGE+2592000) < time()))
|
||||
{
|
||||
$text = "<div style='mediumtext; text-align:center'>".ADLAN_102." <a href='".e_ADMIN."updateadmin.php'>".ADLAN_103.'</a></div>';
|
||||
$ns->setUniqueId('e-password-change');
|
||||
return $ns -> tablerender(ADLAN_104, $text, '', true);
|
||||
}
|
||||
}
|
||||
@@ -1207,8 +1207,8 @@ class admin_shortcodes
|
||||
|
||||
// $text .= "\n\t\t\t\t\t</div>";
|
||||
|
||||
|
||||
return ($parm != 'norender') ? $ns -> tablerender(LAN_STATUS, $text, 'core-menu-status', TRUE) : $text;
|
||||
$ns->setUniqueId('e-status-list');
|
||||
return ($parm != 'norender') ? $ns -> tablerender(LAN_STATUS, $text, '', TRUE) : $text;
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -27,7 +27,7 @@ if(!isset($SEARCH_SHORTCODE))
|
||||
if(!isset($SEARCH_TOP_TABLE))
|
||||
{
|
||||
$SEARCH_TOP_TABLE = "<div>
|
||||
<form id='searchform' method='get' action='".e_SELF."'>
|
||||
<form id='searchform' method='get' action='{SEARCH_FORM_URL}'>
|
||||
<table style='".USER_WIDTH."' class='table fborder'><tr>
|
||||
<td class='forumheader3' style='width: 40%'>".LAN_199."</td>
|
||||
<td class='forumheader3' style='width: 60%; white-space: nowrap'>
|
||||
@@ -135,7 +135,7 @@ if(!isset($POST_CHECKBOXES))
|
||||
|
||||
|
||||
$SEARCH_TEMPLATE['form']['start'] = '
|
||||
<form class="form-horizontal" role="form" id="searchform" method="get" action="'.e_SELF.'">
|
||||
<form class="form-horizontal" role="form" id="searchform" method="get" action="{SEARCH_FORM_URL}">
|
||||
<div class="form-group">
|
||||
<label for="inputEmail3" class="col-sm-3 control-label">'.LAN_199.'</label>
|
||||
<div class="col-sm-9">{SEARCH_MAIN}
|
||||
|
@@ -4349,24 +4349,25 @@ class e_admin_ui extends e_admin_controller_ui
|
||||
|
||||
$form = e107::getAddon($plug, 'e_admin', $plug."_admin_form"); // class | false.
|
||||
|
||||
foreach($config['fields'] as $k=>$v)
|
||||
if(!empty($config['fields']))
|
||||
{
|
||||
$v['data'] = false; // disable data-saving to db table. .
|
||||
|
||||
$fieldName = 'x_'.$plug.'_'.$k;
|
||||
|
||||
if($v['type'] == 'method' && method_exists($form,$fieldName))
|
||||
foreach($config['fields'] as $k=>$v)
|
||||
{
|
||||
$v['method'] = $plug."_admin_form::".$fieldName;
|
||||
//echo "Found method ".$fieldName." in ".$plug."_menu_form";
|
||||
//echo $form->$fieldName();
|
||||
$v['data'] = false; // disable data-saving to db table. .
|
||||
|
||||
$fieldName = 'x_'.$plug.'_'.$k;
|
||||
|
||||
if($v['type'] == 'method' && method_exists($form,$fieldName))
|
||||
{
|
||||
$v['method'] = $plug."_admin_form::".$fieldName;
|
||||
//echo "Found method ".$fieldName." in ".$plug."_menu_form";
|
||||
//echo $form->$fieldName();
|
||||
}
|
||||
|
||||
|
||||
$this->fields[$fieldName] = $v; // ie. x_plugin_key
|
||||
|
||||
}
|
||||
|
||||
|
||||
$this->fields[$fieldName] = $v; // ie. x_plugin_key
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
if(!empty($config['batchOptions']))
|
||||
|
@@ -513,6 +513,7 @@ class e_menu
|
||||
|
||||
// if($template['noTableRender'] !==true) // XXX Deprecated - causes confusion while themeing. use {SETSTYLE=none} instead.
|
||||
// {
|
||||
$ns->setUniqueId('cmenu-'.$page['menu_name']);
|
||||
$ns->tablerender($caption, $text, 'cmenu-'.$page['menu_template']);
|
||||
// }
|
||||
// else
|
||||
@@ -524,6 +525,7 @@ class e_menu
|
||||
else
|
||||
{
|
||||
$text = $tp->toHTML($page['menu_text'], true, 'parse_sc, constants');
|
||||
$ns->setUniqueId('cmenu-'.$page['menu_name']);
|
||||
$ns->tablerender($caption, $text, 'cmenu');
|
||||
}
|
||||
|
||||
|
@@ -1,45 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* e107 website system
|
||||
*
|
||||
* Copyright (C) 2008-2009 e107 Inc (e107.org)
|
||||
* Released under the terms and conditions of the
|
||||
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
||||
*
|
||||
*
|
||||
*
|
||||
* $Source: /cvs_backup/e107_0.8/e107_handlers/search/advanced_download.php,v $
|
||||
* $Revision$
|
||||
* $Date$
|
||||
* $Author$
|
||||
*/
|
||||
|
||||
if (!defined('e107_INIT')) { exit; }
|
||||
/*
|
||||
$advanced['cat']['type'] = 'dropdown';
|
||||
$advanced['cat']['text'] = LAN_SEARCH_63.':';
|
||||
$advanced['cat']['list'][] = array('id' => 'all', 'title' => LAN_SEARCH_51);
|
||||
|
||||
$advanced_caption['id'] = 'cat';
|
||||
$advanced_caption['title']['all'] = LAN_SEARCH_64;
|
||||
|
||||
if ($sql -> db_Select_gen("SELECT download_category_id, download_category_name FROM #download_category WHERE download_category_parent != 0 AND download_category_class IN (".USERCLASS_LIST.")")) {
|
||||
while ($row = $sql -> db_Fetch()) {
|
||||
$advanced['cat']['list'][] = array('id' => $row['download_category_id'], 'title' => $row['download_category_name']);
|
||||
$advanced_caption['title'][$row['download_category_id']] = LAN_SEARCH_65.' -> '.$row['download_category_name'];
|
||||
}
|
||||
}
|
||||
|
||||
$advanced['date']['type'] = 'date';
|
||||
$advanced['date']['text'] = LAN_SEARCH_66.':';
|
||||
|
||||
$advanced['author']['type'] = 'author';
|
||||
$advanced['author']['text'] = LAN_SEARCH_61.':';
|
||||
|
||||
$advanced['match']['type'] = 'dropdown';
|
||||
$advanced['match']['text'] = LAN_SEARCH_52.':';
|
||||
$advanced['match']['list'][] = array('id' => 0, 'title' => LAN_SEARCH_67);
|
||||
$advanced['match']['list'][] = array('id' => 1, 'title' => LAN_SEARCH_54);
|
||||
*/
|
||||
|
||||
?>
|
@@ -1,64 +0,0 @@
|
||||
<?php
|
||||
/*
|
||||
* e107 website system
|
||||
*
|
||||
* Copyright (C) 2008-2009 e107 Inc (e107.org)
|
||||
* Released under the terms and conditions of the
|
||||
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
||||
*
|
||||
*
|
||||
*
|
||||
* $Source: /cvs_backup/e107_0.8/e107_handlers/search/search_download.php,v $
|
||||
* $Revision$
|
||||
* $Date$
|
||||
* $Author$
|
||||
*/
|
||||
|
||||
if (!defined('e107_INIT')) { exit; }
|
||||
|
||||
// advanced
|
||||
/*
|
||||
$advanced_where = "";
|
||||
if (isset($_GET['cat']) && is_numeric($_GET['cat'])) {
|
||||
$advanced_where .= " d.download_category='".$_GET['cat']."' AND";
|
||||
}
|
||||
|
||||
if (isset($_GET['time']) && is_numeric($_GET['time'])) {
|
||||
$advanced_where .= " d.download_datestamp ".($_GET['on'] == 'new' ? '>=' : '<=')." '".(time() - $_GET['time'])."' AND";
|
||||
}
|
||||
|
||||
if (isset($_GET['author']) && $_GET['author'] != '') {
|
||||
$advanced_where .= " (d.download_author = '".$tp -> toDB($_GET['author'])."') AND";
|
||||
}
|
||||
|
||||
if (isset($_GET['match']) && $_GET['match']) {
|
||||
$search_fields = array('d.download_name');
|
||||
} else {
|
||||
$search_fields = array('d.download_name', 'd.download_url', 'd.download_description', 'd.download_author', 'd.download_author_website');
|
||||
}
|
||||
|
||||
// basic
|
||||
$return_fields = 'd.download_id, d.download_category, download_category_id, d.download_name, d.download_description, d.download_author, d.download_author_website, d.download_datestamp, d.download_class, c.download_category_name, c.download_category_class';
|
||||
$weights = array('1.2', '0.9', '0.6', '0.6', '0.4');
|
||||
$no_results = LAN_198;
|
||||
$where = "download_active > '0' AND d.download_visible IN (".USERCLASS_LIST.") AND c.download_category_class IN (".USERCLASS_LIST.") AND".$advanced_where;
|
||||
$order = array('download_datestamp' => DESC);
|
||||
$table = "download AS d LEFT JOIN #download_category AS c ON d.download_category = c.download_category_id";
|
||||
|
||||
$ps = $sch -> parsesearch($table, $return_fields, $search_fields, $weights, 'search_downloads', $no_results, $where, $order);
|
||||
$text .= $ps['text'];
|
||||
$results = $ps['results'];
|
||||
|
||||
function search_downloads($row) {
|
||||
global $con;
|
||||
$datestamp = $con -> convert_date($row['download_datestamp'], "long");
|
||||
$res['link'] = "download.php?view.".$row['download_id'];
|
||||
$res['pre_title'] = $row['download_category_name']." | ";
|
||||
$res['title'] = $row['download_name'];
|
||||
$res['pre_summary'] = "<div class='smalltext'><a href='download.php'>".LAN_197."</a> -> <a href='download.php?list.".$row['download_category_id']."'>".$row['download_category_name']."</a></div>";
|
||||
$res['summary'] = $row['download_description'];
|
||||
$res['detail'] = LAN_SEARCH_15." ".$row['download_author']." | ".LAN_SEARCH_66.": ".$datestamp;
|
||||
return $res;
|
||||
}
|
||||
*/
|
||||
?>
|
@@ -61,12 +61,12 @@ if (isset($custom_query[5]) && $custom_query[5]) {
|
||||
$value_text = "value=''";
|
||||
}
|
||||
|
||||
|
||||
$search_form_url = e107::getUrl()->create('search');
|
||||
|
||||
if(deftrue('BOOTSTRAP'))
|
||||
{
|
||||
$text = '
|
||||
<form class="form-inline" method="get" action="'.e_HTTP.'search.php">
|
||||
<form class="form-inline" method="get" action="'.$search_form_url.'">
|
||||
<div class="input-group">
|
||||
<input class="form-control search" type="text" name="q" size="20" maxlength="50" '.$value_text.' />
|
||||
<input type="hidden" name="r" value="0" />';
|
||||
@@ -85,7 +85,7 @@ if(deftrue('BOOTSTRAP'))
|
||||
}
|
||||
else // Legacy v1 code.
|
||||
{
|
||||
$text = "<form class='form-inline' method='get' action='".e_HTTP."search.php'>";
|
||||
$text = "<form class='form-inline' method='get' action='".$search_form_url."'>";
|
||||
|
||||
$text .= "
|
||||
<div>
|
||||
@@ -109,7 +109,10 @@ else // Legacy v1 code.
|
||||
if (isset($searchflat) && $searchflat)
|
||||
{
|
||||
echo $text;
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
$ns->tablerender(LAN_SEARCH." ".SITENAME, "<div style='text-align:center'>".$text."</div>", 'search');
|
||||
}
|
||||
|
||||
?>
|
@@ -101,6 +101,9 @@ class bootstrap3_admintheme
|
||||
|
||||
$style = $data['setStyle'];
|
||||
|
||||
// echo "Style: ".$style;
|
||||
|
||||
echo "\n\n<!-- UniqueID: ".$data['uniqueId']." -->\n\n";
|
||||
$class = '';
|
||||
|
||||
if(is_string($mode) && $mode == 'admin_help')
|
||||
|
47
search.php
47
search.php
@@ -86,7 +86,19 @@ class search extends e_shortcode
|
||||
}
|
||||
else
|
||||
{
|
||||
if (file_exists(THEME."search_template.php"))
|
||||
$SEARCH_TOP_TABLE = '';
|
||||
$SEARCH_BOT_TABLE = '';
|
||||
$SEARCH_CATS = '';
|
||||
$SEARCH_TYPE = '';
|
||||
$SEARCH_ADV = '';
|
||||
$SEARCH_ENHANCED = '';
|
||||
$SEARCH_ADV_COMBO = '';
|
||||
|
||||
if (file_exists(THEME."templates/search_template.php"))
|
||||
{
|
||||
require(THEME."templates/search_template.php");
|
||||
}
|
||||
elseif (file_exists(THEME."search_template.php"))
|
||||
{
|
||||
require(THEME."search_template.php");
|
||||
}
|
||||
@@ -226,9 +238,28 @@ class search extends e_shortcode
|
||||
return $this->message;
|
||||
}
|
||||
|
||||
function sc_search_form_url($parm='')
|
||||
{
|
||||
return e107::getUrl()->create('search');
|
||||
}
|
||||
|
||||
|
||||
|
||||
// -----------------------
|
||||
|
||||
|
||||
|
||||
private function selectElement($parm)
|
||||
{
|
||||
// standard search config
|
||||
$dropdown = '';
|
||||
$PRE_CHECKBOXES = '';
|
||||
$POST_CHECKBOXES = '';
|
||||
|
||||
$search_count = count($this->search_info);
|
||||
$google_id = $search_count + 1;
|
||||
|
||||
|
||||
if ($this->search_prefs['selector'] == 2)
|
||||
{
|
||||
$dropdown = "<select name='t' id='t' class='tbox form-control e-ajax' data-src='".e_SELF."' data-target='search-advanced' >";
|
||||
@@ -274,7 +305,7 @@ class search extends e_shortcode
|
||||
{
|
||||
if ($this->search_prefs['selector'] == 2)
|
||||
{
|
||||
$dropdown .= "<option value='".$google_id."'>Google</option>"; //FIXME googleid
|
||||
$dropdown .= "<option value='".$google_id."'>Google</option>";
|
||||
}
|
||||
else if
|
||||
($this->search_prefs['selector'] == 1) //FIXME PRE_CHECKBOXES and POST_CHECKBOXES
|
||||
@@ -352,6 +383,8 @@ class search extends e_shortcode
|
||||
return '';
|
||||
}
|
||||
|
||||
$text = '';
|
||||
|
||||
|
||||
if (isset($this->search_info[$parm]['advanced']))
|
||||
{
|
||||
@@ -713,7 +746,7 @@ class search extends e_shortcode
|
||||
|
||||
function renderResults()
|
||||
{
|
||||
global $query, $search_prefs, $pre_title, $search_chars, $search_res, $result_flag;
|
||||
global $query, $search_prefs, $pre_title, $search_chars, $search_res, $result_flag, $advanced_caption;
|
||||
|
||||
$ns = e107::getRender();
|
||||
|
||||
@@ -803,7 +836,7 @@ class search extends e_shortcode
|
||||
$temp1 = preg_replace('/[^\w_ +]/i','',$pparm_value); // Filter 'non-word' charcters in search term
|
||||
if (($temp == $pparm_key) && !isset($core_parms[$pparm_key]))
|
||||
{
|
||||
$parms .= "&".$pparm_key."=".$temp1;
|
||||
// $parms .= "&".$pparm_key."=".$temp1; //FIXME Unused
|
||||
}
|
||||
}
|
||||
if ($results > $search_res)
|
||||
@@ -1254,7 +1287,11 @@ if(deftrue('BOOTSTRAP'))
|
||||
}
|
||||
else
|
||||
{
|
||||
if (file_exists(THEME."search_template.php"))
|
||||
if (file_exists(THEME."templates/search_template.php"))
|
||||
{
|
||||
require(THEME."templates/search_template.php");
|
||||
}
|
||||
elseif (file_exists(THEME."search_template.php"))
|
||||
{
|
||||
require(THEME."search_template.php");
|
||||
}
|
||||
|
Reference in New Issue
Block a user