mirror of
https://github.com/e107inc/e107.git
synced 2025-08-01 12:20:44 +02:00
Various fixes. deprecated e_linkgen in favour of e_sitelink. Easy and dynamic creation of links. Some common functions added to make loading of e_xxx config() functions easier.
This commit is contained in:
@@ -11,8 +11,8 @@
|
||||
| GNU General Public License (http://gnu.org/).
|
||||
|
|
||||
| $Source: /cvs_backup/e107_0.8/e107_admin/cron.php,v $
|
||||
| $Revision: 1.19 $
|
||||
| $Date: 2009-11-18 21:59:16 $
|
||||
| $Revision: 1.20 $
|
||||
| $Date: 2009-11-20 05:01:30 $
|
||||
| $Author: e107coders $
|
||||
+----------------------------------------------------------------------------+
|
||||
*/
|
||||
@@ -306,36 +306,14 @@ function setCronPwd()
|
||||
|
||||
}
|
||||
|
||||
function cronLoad()
|
||||
function cronLoad() //TODO Make a generic function to work with e_cron, e_sitelink, e_url etc.
|
||||
{
|
||||
global $pref;
|
||||
|
||||
$core_cron = $this->coreCrons;
|
||||
$new_cron = array();
|
||||
|
||||
if(vartrue($pref['e_cron_list']))
|
||||
{
|
||||
|
||||
foreach($pref['e_cron_list'] as $key=>$val)
|
||||
{
|
||||
$eplug_cron = array();
|
||||
if(is_readable(e_PLUGIN.$key."/e_cron.php"))
|
||||
{
|
||||
include_once(e_PLUGIN.$key."/e_cron.php");
|
||||
|
||||
$class_name = $key."_cron";
|
||||
$method_name = 'config';
|
||||
|
||||
if($array = $this->cronExecuteMethod($class_name,$method_name,'data'))
|
||||
{
|
||||
$new_cron[] = $array;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$new_cron = e107::getAddonConfig('e_cron');
|
||||
$this->e_cron = array_merge($core_cron,$new_cron);
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
|
@@ -9,8 +9,8 @@
|
||||
* Administration Area - Site Links
|
||||
*
|
||||
* $Source: /cvs_backup/e107_0.8/e107_admin/links.php,v $
|
||||
* $Revision: 1.33 $
|
||||
* $Date: 2009-11-18 01:04:26 $
|
||||
* $Revision: 1.34 $
|
||||
* $Date: 2009-11-20 05:01:30 $
|
||||
* $Author: e107coders $
|
||||
*
|
||||
*/
|
||||
@@ -197,6 +197,7 @@ class links
|
||||
var $linkCategory = array();
|
||||
var $linkOpen = array();
|
||||
var $mode = 'main';
|
||||
private $linkFunctions = array();
|
||||
|
||||
function __construct()
|
||||
{
|
||||
@@ -208,6 +209,22 @@ class links
|
||||
$this->mode = $_GET['mode'];
|
||||
}
|
||||
|
||||
// get e_sitelink functions.
|
||||
$tmp = e107::getAddonConfig('e_sitelink','sitelinks');
|
||||
$this->linkFunctions[0] = "(".LAN_OPTIONAL.")";
|
||||
foreach($tmp as $cat=> $array)
|
||||
{
|
||||
$func = array();
|
||||
foreach($array as $val)
|
||||
{
|
||||
$newkey = $cat.'::'.$val['function'];
|
||||
$func[$newkey] = $val['name'];
|
||||
}
|
||||
$this->linkFunctions[$cat] = $func;
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (varset($_POST['etrigger_ecolumns']))
|
||||
{
|
||||
$user_pref['admin_links_columns'] = $_POST['e-columns'];
|
||||
@@ -229,6 +246,7 @@ class links
|
||||
|
||||
$this->linkOpen = array(
|
||||
0 => LCLAN_20, // 0 = same window
|
||||
1 => LCLAN_23, // new window
|
||||
4 => LCLAN_24, // 4 = miniwindow 600x400
|
||||
5 => LINKLAN_1 // 5 = miniwindow 800x600
|
||||
);
|
||||
@@ -337,7 +355,7 @@ class links
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
function getLinks()
|
||||
{
|
||||
@@ -780,10 +798,14 @@ class links
|
||||
// Show the form for link create/edit
|
||||
function create_link($sub_action, $id)
|
||||
{
|
||||
global $sql, $e107, $pst, $tp, $emessage;
|
||||
|
||||
$frm = new e_form();
|
||||
global $e107, $pst, $emessage;
|
||||
|
||||
$frm = e107::getForm();
|
||||
$sql = e107::getDb();
|
||||
$tp = e107::getParser();
|
||||
$fl = e107::getFile();
|
||||
$ns = e107::getRender();
|
||||
|
||||
$preset = $pst->read_preset("admin_links");
|
||||
extract($preset);
|
||||
|
||||
@@ -806,13 +828,7 @@ class links
|
||||
$link_name = $this->linkName($link_name);
|
||||
}
|
||||
|
||||
require_once (e_HANDLER."file_class.php");
|
||||
$fl = new e_file();
|
||||
|
||||
if($iconlist = $fl->get_files(e_IMAGE."icons/", '\.jpg|\.gif|\.png|\.JPG|\.GIF|\.PNG'))
|
||||
{
|
||||
sort($iconlist);
|
||||
}
|
||||
$text = "
|
||||
|
||||
<form method='post' action='".e_SELF."' id='core-links-edit-form'>
|
||||
@@ -825,115 +841,111 @@ class links
|
||||
</colgroup>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class='label'>".LINKLAN_2."</td>
|
||||
<td class='control'>
|
||||
<td>".LINKLAN_2."</td>
|
||||
<td>
|
||||
<select class='tbox select' name='link_parent' >
|
||||
".$this->dropdown($link_parent)."
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class='label'>".LCLAN_15.": </td>
|
||||
<td class='control'>
|
||||
<td>".LCLAN_15.": </td>
|
||||
<td>
|
||||
<input class='tbox input-text' type='text' name='link_name' size='60' value='{$link_name}' maxlength='100' />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class='label'>".LCLAN_16.": </td>
|
||||
<td class='control'>
|
||||
<td>".LCLAN_16.": </td>
|
||||
<td>
|
||||
<input class='tbox input-text' type='text' name='link_url' size='60' value='".$tp->replaceConstants($link_url, TRUE)."' maxlength='200' />
|
||||
".((e_MENU == "debug") ? $link_url : "")."
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class='label'>".LCLAN_17.": </td>
|
||||
<td class='control'>
|
||||
<td>".LCLAN_17.": </td>
|
||||
<td>
|
||||
<textarea class='tbox textarea' id='link_description' name='link_description' cols='70' rows='5' onselect='storeCaret(this);' onclick='storeCaret(this);' onkeyup='storeCaret(this)'>".$tp->toForm($link_description)."</textarea>
|
||||
<br/>".display_help("helpb", "admin")."
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class='label'>".LCLAN_18.": </td>
|
||||
<td class='control'>
|
||||
<td>".LCLAN_18.": </td>
|
||||
<td>
|
||||
|
||||
";
|
||||
|
||||
//SecretR - more nice view now handled by e_form (inner use of new sc {ICONPICKER})
|
||||
//Example sc opts (4th func argument)
|
||||
//$opts = 'path='.e_IMAGE.'icons/|'.e_IMAGE.'generic/';
|
||||
//$opts .= '&path_omit='.e_IMAGE.'icons/';
|
||||
|
||||
$text .= $frm->iconpicker('link_button', $link_button, LCLAN_39);
|
||||
|
||||
// 1 = _blank
|
||||
// 2 = _parent not in use.
|
||||
// 3 = _top not in use.
|
||||
$linkop[0] = LCLAN_20; // 0 = same window
|
||||
$linkop[1] = LCLAN_23;
|
||||
$linkop[4] = LCLAN_24; // 4 = miniwindow 600x400
|
||||
$linkop[5] = LINKLAN_1; // 5 = miniwindow 800x600
|
||||
|
||||
|
||||
$text .= "</td>
|
||||
$text .= "
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class='label'>".LCLAN_19.": </td>
|
||||
<td class='control'>
|
||||
<select name='linkopentype' class='tbox select'>
|
||||
";
|
||||
foreach($linkop as $key => $val)
|
||||
{
|
||||
$selectd = ($link_open == $key) ? " selected='selected'" : "";
|
||||
$text .= "<option value='$key'{$selectd}>".$val."</option>\n";
|
||||
}
|
||||
<td class='label'>".LCLAN_19.": </td>
|
||||
<td class='control'>
|
||||
<select name='linkopentype' class='tbox select'>\n";
|
||||
|
||||
foreach($this->linkOpen as $key => $val)
|
||||
{
|
||||
$selectd = ($link_open == $key) ? " selected='selected'" : "";
|
||||
$text .= "<option value='$key'{$selectd}>".$val."</option>\n";
|
||||
}
|
||||
|
||||
$text .= "
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class='label'>".LCLAN_12.": </td>
|
||||
<td class='control'>
|
||||
<select name='linkrender' class='tbox select'>
|
||||
";
|
||||
$rentype = array("", "Main", "Alt", "Alt", "Alt", "Alt", "Alt", "Alt", "Alt", "Alt", "Alt");
|
||||
for($i = 1; $i < count($rentype); $i++)
|
||||
{
|
||||
$sel = ($link_category == $i) ? " selected='selected'" : "";
|
||||
$text .= "<option value='$i'{$sel}>$i - ".$rentype[$i]."</option>";
|
||||
}
|
||||
;
|
||||
<td>".LCLAN_12.": </td>
|
||||
<td>
|
||||
<select name='linkrender' class='tbox select'>";
|
||||
|
||||
foreach($this->linkCategory as $i=>$val)
|
||||
{
|
||||
$sel = ($link_category == $i) ? " selected='selected'" : "";
|
||||
$text .= "<option value='$i' {$sel}>".$val."</option>";
|
||||
}
|
||||
|
||||
|
||||
$text .= "
|
||||
</select>
|
||||
<div class='smalltext field-help'>".LCLAN_96." {SITELINKS=flat:[rendertype number]}</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class='label'>".LCLAN_25.":
|
||||
|
||||
</td>
|
||||
<td class='control'>
|
||||
".r_userclass("link_class", $link_class, "off", "public,guest,nobody,member,main,admin,classes")."
|
||||
<div class='smalltext field-help'>(".LCLAN_26.")</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class='buttons-bar center'>
|
||||
";
|
||||
if($id && $sub_action == "edit")
|
||||
{
|
||||
$text .= "
|
||||
<button class='update' type='submit' name='add_link' value='no-value'><span>".LCLAN_27."</span></button>
|
||||
<input type='hidden' name='link_id' value='{$link_id}' />
|
||||
";
|
||||
} else
|
||||
{
|
||||
$text .= "
|
||||
<button class='create' type='submit' name='add_link' value='no-value'><span>".LCLAN_28."</span></button>
|
||||
";
|
||||
}
|
||||
$text .= "</select>
|
||||
<div class='smalltext field-help'>".LCLAN_96." {SITELINKS=flat:[rendertype number]}</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>".LCLAN_25.":</td>
|
||||
<td>".r_userclass("link_class", $link_class, "off", "public,guest,nobody,member,main,admin,classes")."
|
||||
<div class='smalltext field-help'>(".LCLAN_26.")</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>".LINKLAN_6.":</td>
|
||||
<td>".$frm->selectbox('link_function',$this->linkFunctions,$link_function) ."</td>
|
||||
</tr>
|
||||
|
||||
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
<div class='buttons-bar center'>\n";
|
||||
|
||||
if($id && $sub_action == "edit")
|
||||
{
|
||||
$text .= "
|
||||
<button class='update' type='submit' name='add_link' value='no-value'><span>".LCLAN_27."</span></button>
|
||||
<input type='hidden' name='link_id' value='{$link_id}' />
|
||||
";
|
||||
} else
|
||||
{
|
||||
$text .= "
|
||||
<button class='create' type='submit' name='add_link' value='no-value'><span>".LCLAN_28."</span></button>
|
||||
";
|
||||
}
|
||||
$text .= "
|
||||
</div>
|
||||
</fieldset>
|
||||
@@ -957,29 +969,52 @@ class links
|
||||
$link_url = str_replace("&", "&", $link_url); // xhtml compliant links.
|
||||
|
||||
|
||||
$link_description = $tp->toDB($_POST['link_description']);
|
||||
$link_button = $tp->toDB($_POST['link_button']);
|
||||
$link_render = intval($_POST['linkrender']);
|
||||
$link_open = intval($_POST['linkopentype']);
|
||||
// $link_description = ;
|
||||
// $link_button = ;
|
||||
// $link_render = ;
|
||||
// $link_open = ;
|
||||
$link_class = $tp->toDB($_POST['link_class']);
|
||||
|
||||
$message = implode('[!br!]', array($link_name, $link_url, $link_class)); // Probably enough to log
|
||||
$link_t = $sql->db_Count("links", "(*)");
|
||||
|
||||
|
||||
$insert = array(
|
||||
'link_parent' => $parent_id,
|
||||
'link_name' => $link_name,
|
||||
'link_url' => $link_url,
|
||||
'link_description' => $tp->toDB($_POST['link_description']),
|
||||
'link_button' => $tp->toDB($_POST['link_button']),
|
||||
'link_category' => intval($_POST['linkrender']),
|
||||
'link_open' => intval($_POST['linkopentype']),
|
||||
'link_class' => $link_class,
|
||||
'link_function' => $_POST['link_function'],
|
||||
'WHERE' => "link_id=".$id
|
||||
);
|
||||
|
||||
|
||||
|
||||
if($id)
|
||||
{
|
||||
$sql->db_Update("links", "link_parent='{$parent_id}', link_name='{$link_name}', link_url='{$link_url}', link_description='{$link_description}', link_button= '{$link_button}', link_category='{$link_render}', link_open='{$link_open}', link_class='{$link_class}' WHERE link_id='{$id}'");
|
||||
// $sql->db_Update("links", "link_parent='{$parent_id}', link_name='{$link_name}', link_url='{$link_url}', link_description='{$link_description}', link_button= '{$link_button}', link_category='{$link_render}', link_open='{$link_open}', link_class='{$link_class}' WHERE link_id='{$id}'");
|
||||
$status = $sql->db_Update("links", $insert) ? E_MESSAGE_SUCCESS : E_MESSAGE_ERROR;
|
||||
|
||||
//rename all sublinks to eliminate old embedded 'submenu' etc hierarchy.
|
||||
// this is for upgrade compatibility only. Current hierarchy uses link_parent.
|
||||
$e107cache->clear("sitelinks");
|
||||
sitelinks_adminlog('08', $message);
|
||||
$emessage->add(LCLAN_3, E_MESSAGE_SUCCESS);
|
||||
$emessage->add(LCLAN_3, $status);
|
||||
}
|
||||
else
|
||||
{ // New link
|
||||
$sql->db_Insert("links", "0, '$link_name', '$link_url', '$link_description', '$link_button', ".$link_render.", ".($link_t + 1).", ".$parent_id.", ".$link_open.", ".$link_class,TRUE);
|
||||
|
||||
$insert['link_order'] = $link_t + 1;
|
||||
// $sql->db_Insert("links", "0, '$link_name', '$link_url', '$link_description', '$link_button', ".$link_render.", ".($link_t + 1).", ".$parent_id.", ".$link_open.", ".$link_class,TRUE);
|
||||
$status = $sql->db_Insert("links", $insert) ? E_MESSAGE_SUCCESS : E_MESSAGE_ERROR;
|
||||
|
||||
$e107cache->clear("sitelinks");
|
||||
sitelinks_adminlog('07', $message);
|
||||
$emessage->add(LCLAN_2, E_MESSAGE_SUCCESS);
|
||||
$emessage->add(LCLAN_2, $status);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -9,8 +9,8 @@
|
||||
* Core SQL
|
||||
*
|
||||
* $Source: /cvs_backup/e107_0.8/e107_admin/sql/core_sql.php,v $
|
||||
* $Revision: 1.40 $
|
||||
* $Date: 2009-11-19 12:35:33 $
|
||||
* $Revision: 1.41 $
|
||||
* $Date: 2009-11-20 05:01:30 $
|
||||
* $Author: e107coders $
|
||||
*/
|
||||
|
||||
@@ -207,6 +207,7 @@ CREATE TABLE links (
|
||||
link_parent int(10) unsigned NOT NULL default '0',
|
||||
link_open tinyint(1) unsigned NOT NULL default '0',
|
||||
link_class varchar(255) NOT NULL default '0',
|
||||
link_function varchar(100) NOT NULL default '',
|
||||
PRIMARY KEY (link_id)
|
||||
) TYPE=MyISAM;
|
||||
|
||||
|
@@ -11,8 +11,8 @@
|
||||
| GNU General Public License (http://gnu.org).
|
||||
|
|
||||
| $Source: /cvs_backup/e107_0.8/e107_admin/update_routines.php,v $
|
||||
| $Revision: 1.62 $
|
||||
| $Date: 2009-11-19 12:35:33 $
|
||||
| $Revision: 1.63 $
|
||||
| $Date: 2009-11-20 05:01:30 $
|
||||
| $Author: e107coders $
|
||||
+----------------------------------------------------------------------------+
|
||||
*/
|
||||
@@ -263,7 +263,7 @@ function update_706_to_800($type='')
|
||||
// List of changed DB tables (defined in core_sql.php)
|
||||
// (primarily those which have changed significantly; for the odd field write some explicit code - it'll run faster)
|
||||
$changed_tables = array('user', 'dblog','admin_log', 'userclass_classes', 'banlist', 'menus',
|
||||
'plugin', 'news', 'news_category','online', 'page');
|
||||
'plugin', 'news', 'news_category','online', 'page', 'links');
|
||||
|
||||
|
||||
// List of changed DB tables from core plugins (defined in pluginname_sql.php file)
|
||||
@@ -328,7 +328,7 @@ function update_706_to_800($type='')
|
||||
|
||||
|
||||
// Check that custompages have been imported from current theme.php file
|
||||
if(!varset($pref['sitetheme_custompages']))
|
||||
if(!array_key_exists('sitetheme_custompages',$pref))
|
||||
{
|
||||
$th = e107::getSingleton('themeHandler');
|
||||
$tmp = $th->getThemeInfo($pref['sitetheme']);
|
||||
|
@@ -9,9 +9,9 @@
|
||||
* e107 Main
|
||||
*
|
||||
* $Source: /cvs_backup/e107_0.8/e107_handlers/e107_class.php,v $
|
||||
* $Revision: 1.77 $
|
||||
* $Date: 2009-11-19 11:12:08 $
|
||||
* $Author: secretr $
|
||||
* $Revision: 1.78 $
|
||||
* $Date: 2009-11-20 05:01:30 $
|
||||
* $Author: e107coders $
|
||||
*/
|
||||
|
||||
if (!defined('e107_INIT')) { exit; }
|
||||
@@ -899,6 +899,86 @@ class e107
|
||||
return self::getRegistry('admin/ui/dispatcher');
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Retrieves config() from addons such as e_url.php, e_cron.php, e_sitelink.php
|
||||
* @param str $addonName eg. e_cron, e_url
|
||||
* @param str $className [optional] (if different from addonName)
|
||||
* @return
|
||||
*/
|
||||
public function getAddonConfig($addonName,$className='')
|
||||
{
|
||||
global $pref;
|
||||
|
||||
$new_cron = array();
|
||||
|
||||
$filename = $addonName; // 'e_cron';
|
||||
if(!$className)
|
||||
{
|
||||
$className = str_replace("e_","",$filename);
|
||||
}
|
||||
|
||||
if(vartrue($pref[$filename.'_list']))
|
||||
{
|
||||
|
||||
foreach($pref[$filename.'_list'] as $key=>$val)
|
||||
{
|
||||
$eplug_cron = array();
|
||||
if(is_readable(e_PLUGIN.$key."/".$filename.".php"))
|
||||
{
|
||||
include_once(e_PLUGIN.$key."/".$filename.".php");
|
||||
|
||||
$class_name = $key."_".$className;// cron";
|
||||
$method_name = 'config';
|
||||
|
||||
if($array = self::callMethod($class_name,$method_name))
|
||||
{
|
||||
$new_cron[$key] = $array;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $new_cron;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Safe way to call user methods.
|
||||
* @param str $class_name
|
||||
* @param str $method_name
|
||||
* @return
|
||||
*/
|
||||
public function callMethod($class_name,$method_name)
|
||||
{
|
||||
$mes = e107::getMessage();
|
||||
|
||||
if(class_exists($class_name))
|
||||
{
|
||||
$obj = new $class_name;
|
||||
if(method_exists($obj,$method_name))
|
||||
{
|
||||
$mes->add("Executing <b>".$class_name." :: ".$method_name."()</b>", E_MESSAGE_DEBUG);
|
||||
return call_user_func(array($obj,$method_name));
|
||||
}
|
||||
else
|
||||
{
|
||||
$mes->add("Function <b>".$class_name." :: ".$method_name."()</b> NOT found.", E_MESSAGE_DEBUG);
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Retrieve core template path
|
||||
* Example: <code>echo e107::coreTemplatePath('admin_icons');</code>
|
||||
|
@@ -9,8 +9,8 @@
|
||||
* Form Handler
|
||||
*
|
||||
* $Source: /cvs_backup/e107_0.8/e107_handlers/form_handler.php,v $
|
||||
* $Revision: 1.87 $
|
||||
* $Date: 2009-11-19 10:07:32 $
|
||||
* $Revision: 1.88 $
|
||||
* $Date: 2009-11-20 05:01:31 $
|
||||
* $Author: e107coders $
|
||||
*
|
||||
*/
|
||||
@@ -478,7 +478,19 @@ class e_form
|
||||
$text = '';
|
||||
foreach ($option_array as $value => $label)
|
||||
{
|
||||
$text .= $this->option($label, $value, $selected == $value, $options)."\n";
|
||||
if(is_array($label))
|
||||
{
|
||||
$text .= $this->optgroup_open($value);
|
||||
foreach($label as $val => $lab)
|
||||
{
|
||||
$text .= $this->option($lab, $val, ($selected == $val), $options)."\n";
|
||||
}
|
||||
$text .= $this->optgroup_close();
|
||||
}
|
||||
else
|
||||
{
|
||||
$text .= $this->option($label, $value, $selected == $value, $options)."\n";
|
||||
}
|
||||
}
|
||||
|
||||
return $text;
|
||||
|
@@ -9,8 +9,8 @@
|
||||
* mySQL Handler
|
||||
*
|
||||
* $Source: /cvs_backup/e107_0.8/e107_handlers/mysql_class.php,v $
|
||||
* $Revision: 1.63 $
|
||||
* $Date: 2009-11-18 01:04:43 $
|
||||
* $Revision: 1.64 $
|
||||
* $Date: 2009-11-20 05:01:31 $
|
||||
* $Author: e107coders $
|
||||
*/
|
||||
|
||||
@@ -49,7 +49,7 @@ $db_ConnectionID = NULL; // Stores ID for the first DB connection used - which s
|
||||
*
|
||||
* @package e107
|
||||
* @category e107_handlers
|
||||
* @version $Revision: 1.63 $
|
||||
* @version $Revision: 1.64 $
|
||||
* @author $Author: e107coders $
|
||||
*
|
||||
*/
|
||||
@@ -372,6 +372,10 @@ class e_db_mysql {
|
||||
$this->mySQLcurTable = $table;
|
||||
if(is_array($arg))
|
||||
{
|
||||
if(isset($arg['WHERE'])) // use same array for update and insert.
|
||||
{
|
||||
unset($arg['WHERE']);
|
||||
}
|
||||
if(isset($arg['_REPLACE']))
|
||||
{
|
||||
$REPLACE = TRUE;
|
||||
|
@@ -9,8 +9,8 @@
|
||||
* Administration - Site Maintenance
|
||||
*
|
||||
* $Source: /cvs_backup/e107_0.8/e107_handlers/plugin_class.php,v $
|
||||
* $Revision: 1.116 $
|
||||
* $Date: 2009-11-18 01:04:43 $
|
||||
* $Revision: 1.117 $
|
||||
* $Date: 2009-11-20 05:01:31 $
|
||||
* $Author: e107coders $
|
||||
*
|
||||
*/
|
||||
@@ -46,7 +46,8 @@ class e107plugin
|
||||
'e_tagwords',
|
||||
'e_url',
|
||||
'e_cron',
|
||||
'e_mailout'
|
||||
'e_mailout',
|
||||
'e_sitelink'
|
||||
);
|
||||
|
||||
// List of all plugin variables which need to be checked - install required if one or more set and non-empty
|
||||
|
@@ -9,8 +9,8 @@
|
||||
*
|
||||
*
|
||||
* $Source: /cvs_backup/e107_0.8/e107_handlers/sitelinks_class.php,v $
|
||||
* $Revision: 1.22 $
|
||||
* $Date: 2009-11-18 01:04:43 $
|
||||
* $Revision: 1.23 $
|
||||
* $Date: 2009-11-20 05:01:31 $
|
||||
* $Author: e107coders $
|
||||
*/
|
||||
|
||||
@@ -24,23 +24,43 @@ class sitelinks
|
||||
var $eLinkList;
|
||||
|
||||
function getlinks($cat=1)
|
||||
{
|
||||
|
||||
global $sql;
|
||||
if ($sql->db_Select('links', '*', "link_category = ".intval($cat)." and link_class IN (".USERCLASS_LIST.") ORDER BY link_order ASC")){
|
||||
{
|
||||
$sql = e107::getDb('sqlSiteLinks');
|
||||
|
||||
$query = "SELECT * FROM #links WHERE link_category = ".intval($cat)." and link_class IN (".USERCLASS_LIST.") ORDER BY link_order ASC";
|
||||
if($sql->db_Select_gen($query))
|
||||
{
|
||||
while ($row = $sql->db_Fetch())
|
||||
{
|
||||
// if (substr($row['link_name'], 0, 8) == 'submenu.'){
|
||||
// $tmp=explode('.', $row['link_name'], 3);
|
||||
// $this->eLinkList[$tmp[1]][]=$row;
|
||||
if (isset($row['link_parent']) && $row['link_parent'] != 0){
|
||||
if (isset($row['link_parent']) && $row['link_parent'] != 0)
|
||||
{
|
||||
$this->eLinkList['sub_'.$row['link_parent']][]=$row;
|
||||
}else{
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
$this->eLinkList['head_menu'][] = $row;
|
||||
if(vartrue($row['link_function']))
|
||||
{
|
||||
list($path,$method) = explode("::",$row['link_function']);
|
||||
if(include_once(e_PLUGIN.$path."/e_sitelink.php"))
|
||||
{
|
||||
$class = $path."_sitelinks";
|
||||
$sublinkArray = e107::callMethod($class,$method); //TODO Cache it.
|
||||
if(vartrue($sublinkArray))
|
||||
{
|
||||
$this->eLinkList['sub_'.$row['link_id']] = $sublinkArray;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
function get($cat=1, $style='', $css_class = false)
|
||||
|
@@ -1,15 +1,15 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright e107 Inc e107.org, Licensed under GNU GPL (http://www.gnu.org/licenses/gpl.txt)
|
||||
* $Id: lan_links.php,v 1.5 2009-10-26 07:44:35 e107coders Exp $
|
||||
* $Id: lan_links.php,v 1.6 2009-11-20 05:01:42 e107coders Exp $
|
||||
*
|
||||
* Admin Language File
|
||||
*
|
||||
*/
|
||||
|
||||
define("LCLAN_1", "Options Saved");
|
||||
define("LCLAN_2", "Link saved to database.");
|
||||
define("LCLAN_3", "Link updated in database.");
|
||||
define("LCLAN_2", "Saving link to database.");
|
||||
define("LCLAN_3", "Updating link in database.");
|
||||
// define("LCLAN_4", "Link deleted.");
|
||||
define("LCLAN_6", "Order updated.");
|
||||
define("LCLAN_8", "Site Navigation Links");
|
||||
|
75
e107_plugins/faqs/e_sitelink.php
Normal file
75
e107_plugins/faqs/e_sitelink.php
Normal file
@@ -0,0 +1,75 @@
|
||||
<?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)
|
||||
*
|
||||
* Sitelinks configuration module - gsitemap
|
||||
*
|
||||
* $Source: /cvs_backup/e107_0.8/e107_plugins/faqs/e_sitelink.php,v $
|
||||
* $Revision: 1.1 $
|
||||
* $Date: 2009-11-20 05:01:51 $
|
||||
* $Author: e107coders $
|
||||
*
|
||||
*/
|
||||
|
||||
if (!defined('e107_INIT')) { exit; }
|
||||
/*if(!plugInstalled('gsitemap'))
|
||||
{
|
||||
return;
|
||||
}*/
|
||||
|
||||
|
||||
class faqs_sitelinks // include plugin-folder in the name.
|
||||
{
|
||||
function config()
|
||||
{
|
||||
global $pref;
|
||||
|
||||
$links = array();
|
||||
|
||||
$links[] = array(
|
||||
'name' => "FAQ Categories",
|
||||
'function' => "faqCategories",
|
||||
'description' => "FAQ Category links"
|
||||
);
|
||||
|
||||
|
||||
return $links;
|
||||
}
|
||||
|
||||
|
||||
|
||||
function faqCategories()
|
||||
{
|
||||
$sql = e107::getDb();
|
||||
$sublinks = array();
|
||||
|
||||
$sql->db_Select("faqs_info","*","faq_info_id != '' ORDER BY faq_info_order");
|
||||
|
||||
while($row = $sql->db_Fetch())
|
||||
{
|
||||
$sublinks[] = array(
|
||||
'link_name' => $row['faq_info_title'],
|
||||
'link_url' => '{e_PLUGIN}faqs/faqs.php?cat.'.$row['faq_info_id'],
|
||||
'link_description' => $row['faq_info_about'],
|
||||
'link_button' => '',
|
||||
'link_category' => '',
|
||||
'link_order' => '',
|
||||
'link_parent' => '',
|
||||
'link_open' => '',
|
||||
'link_class' => intval($row['faq_info_class'])
|
||||
);
|
||||
}
|
||||
|
||||
return $sublinks;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
?>
|
@@ -9,8 +9,8 @@
|
||||
*
|
||||
*
|
||||
* $Source: /cvs_backup/e107_0.8/e107_plugins/faqs/faqs.php,v $
|
||||
* $Revision: 1.3 $
|
||||
* $Date: 2009-11-18 01:05:36 $
|
||||
* $Revision: 1.4 $
|
||||
* $Date: 2009-11-20 05:01:51 $
|
||||
* $Author: e107coders $
|
||||
*/
|
||||
|
||||
@@ -272,6 +272,7 @@ class faq
|
||||
$sql->db_Select_gen($qry);
|
||||
while ($row = $sql->db_Fetch())
|
||||
{
|
||||
|
||||
setScVar('faqs_shortcodes', 'row', $row);
|
||||
|
||||
if ($row['faq_info_parent'] == '0') //
|
||||
@@ -372,10 +373,10 @@ class faq
|
||||
{
|
||||
global $faqpref,$timing_start,$tp,$cust_footer, $CUSTOMPAGES, $CUSTOMHEADER, $CUSTOMHEADER;
|
||||
$text_menu .= "<div style='text-align:center;' ><br />
|
||||
[ <a href=\"faq.php?main\">Back to Categories</a> ] ";
|
||||
[ <a href=\"faqs.php?main\">Back to Categories</a> ] ";
|
||||
|
||||
if(check_class($faqpref['add_faq'])){
|
||||
$text_menu .="[ <a href=\"faq.php?new.$id\">Submit a Question</a> ]";
|
||||
$text_menu .="[ <a href=\"faqs.php?new.$id\">Submit a Question</a> ]";
|
||||
}
|
||||
$text_menu .="</div>";
|
||||
|
||||
|
@@ -10,8 +10,8 @@
|
||||
| GNU General Public License (http://gnu.org).
|
||||
|
|
||||
| $Source: /cvs_backup/e107_0.8/e107_plugins/faqs/faqs_shortcodes.php,v $
|
||||
| $Revision: 1.1 $
|
||||
| $Date: 2009-11-09 12:57:34 $
|
||||
| $Revision: 1.2 $
|
||||
| $Date: 2009-11-20 05:01:51 $
|
||||
| $Author: e107coders $
|
||||
+----------------------------------------------------------------------------+
|
||||
*/
|
||||
@@ -65,7 +65,7 @@ class faqs_shortcodes
|
||||
function sc_faq_category()
|
||||
{
|
||||
$tp = e107::getParser();
|
||||
return $tp->toHtml($this->row['faq_info_title']);
|
||||
return "<a href='".e_SELF."?cat.".$this->row['faq_info_id']."'>".$tp->toHtml($this->row['faq_info_title'])."</a>";
|
||||
}
|
||||
|
||||
function sc_faq_catlink()
|
||||
|
72
e107_plugins/page/e_sitelink.php
Normal file
72
e107_plugins/page/e_sitelink.php
Normal file
@@ -0,0 +1,72 @@
|
||||
<?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)
|
||||
*
|
||||
* Sitelinks configuration module - gsitemap
|
||||
*
|
||||
* $Source: /cvs_backup/e107_0.8/e107_plugins/page/e_sitelink.php,v $
|
||||
* $Revision: 1.1 $
|
||||
* $Date: 2009-11-20 05:01:51 $
|
||||
* $Author: e107coders $
|
||||
*
|
||||
*/
|
||||
|
||||
if (!defined('e107_INIT')) { exit; }
|
||||
/*if(!plugInstalled('gsitemap'))
|
||||
{
|
||||
return;
|
||||
}*/
|
||||
|
||||
|
||||
class page_sitelinks // include plugin-folder in the name.
|
||||
{
|
||||
function config()
|
||||
{
|
||||
$links = array();
|
||||
|
||||
$links[] = array(
|
||||
'name' => "All Pages",
|
||||
'function' => "myfunction",
|
||||
'description' => ""
|
||||
);
|
||||
|
||||
return $links;
|
||||
}
|
||||
|
||||
|
||||
|
||||
function myfunction()
|
||||
{
|
||||
$sql = e107::getDb();
|
||||
$sublinks = array();
|
||||
|
||||
$sql->db_Select("page","*","page_theme = '' ORDER BY page_title");
|
||||
|
||||
while($row = $sql->db_Fetch())
|
||||
{
|
||||
$sublinks[] = array(
|
||||
'link_name' => $row['page_title'],
|
||||
'link_url' => 'page.php?'.$row['page_id'],
|
||||
'link_description' => '',
|
||||
'link_button' => '',
|
||||
'link_category' => '',
|
||||
'link_order' => '',
|
||||
'link_parent' => '',
|
||||
'link_open' => '',
|
||||
'link_class' => intval($row['page_class'])
|
||||
);
|
||||
}
|
||||
|
||||
return $sublinks;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
?>
|
Reference in New Issue
Block a user