1
0
mirror of https://github.com/e107inc/e107.git synced 2025-07-12 18:46:20 +02:00

More LAN fixes.

This commit is contained in:
Cameron
2012-12-12 21:30:43 -08:00
parent 971c4fd8b1
commit e0a27eede8
8 changed files with 44 additions and 38 deletions

View File

@ -76,15 +76,15 @@ class links_admin_ui extends e_admin_ui
public $sublink_data = null; public $sublink_data = null;
protected $fields = array( protected $fields = array(
'checkboxes' => array('title'=> '', 'width' => '3%','forced' => true,'thclass' => 'center first','class' => 'center first'), 'checkboxes' => array('title'=> '', 'width' => '3%','forced' => true, 'thclass' => 'center first','class' => 'center first'),
'link_button' => array('title'=> LAN_ICON, 'type'=>'icon', 'width'=>'5%', 'thclass' => 'center', 'class'=>'center'), 'link_button' => array('title'=> LAN_ICON, 'type'=>'icon', 'width'=>'5%', 'thclass' => 'center', 'class'=>'center'),
'link_id' => array('title'=> ID, 'noedit'=>TRUE), 'link_id' => array('title'=> ID, 'noedit'=>TRUE),
'link_name' => array('title'=> LCLAN_15, 'width'=>'auto','type'=>'text', 'validate' => true), 'link_name' => array('title'=> LCLAN_15, 'width'=>'auto','type'=>'text', 'required' => true, 'validate' => true),
'link_parent' => array('title'=> 'Sublink of', 'type' => 'method', 'width' => 'auto', 'batch'=>true, 'filter'=>true, 'thclass' => 'left first'), 'link_parent' => array('title'=> 'Sublink of', 'type' => 'method', 'width' => 'auto', 'batch'=>true, 'filter'=>true, 'thclass' => 'left first'),
'link_url' => array('title'=> LCLAN_93, 'width'=>'auto', 'type'=>'text', 'validate' => true), 'link_url' => array('title'=> LCLAN_93, 'width'=>'auto', 'type'=>'text', 'required'=>true,'validate' => true),
'link_sefurl' => array('title'=> LAN_SEFURL, 'type' => 'text', 'width' => 'auto'), 'link_sefurl' => array('title'=> LAN_SEFURL, 'type' => 'text', 'width' => 'auto'),
'link_class' => array('title'=> LAN_USERCLASS, 'type' => 'userclass', 'writeParms' => 'classlist=public,guest,nobody,member,classes,admin,main', 'batch'=>true, 'filter'=>true, 'width' => 'auto'), 'link_class' => array('title'=> LAN_USERCLASS, 'type' => 'userclass', 'writeParms' => 'classlist=public,guest,nobody,member,classes,admin,main', 'batch'=>true, 'filter'=>true, 'width' => 'auto'),
'link_description' => array('title'=> LCLAN_17, 'type' => 'bbarea', 'method'=>'tinymce_plugins', 'width' => 'auto'), 'link_description' => array('title'=> LCLAN_17, 'type' => 'textarea', 'width' => 'auto'), // 'method'=>'tinymce_plugins', ?
'link_category' => array('title'=> LCLAN_12, 'type' => 'dropdown', 'batch'=>true, 'filter'=>true, 'width' => 'auto'), 'link_category' => array('title'=> LCLAN_12, 'type' => 'dropdown', 'batch'=>true, 'filter'=>true, 'width' => 'auto'),
'link_order' => array('title'=> LAN_ORDER, 'type' => 'number', 'width' => 'auto', 'nolist'=>true), 'link_order' => array('title'=> LAN_ORDER, 'type' => 'number', 'width' => 'auto', 'nolist'=>true),
'link_open' => array('title'=> LCLAN_19, 'type' => 'dropdown', 'width' => 'auto', 'batch'=>true, 'filter'=>true, 'thclass' => 'left first'), 'link_open' => array('title'=> LCLAN_19, 'type' => 'dropdown', 'width' => 'auto', 'batch'=>true, 'filter'=>true, 'thclass' => 'left first'),
@ -542,7 +542,7 @@ class links_admin_form_ui extends e_admin_form_ui
function init() function init()
{ {
$tp = e107::getParser();
$tmp = e107::getAddonConfig('e_sitelink','sitelinks'); $tmp = e107::getAddonConfig('e_sitelink','sitelinks');
foreach($tmp as $cat=> $array) foreach($tmp as $cat=> $array)
@ -551,7 +551,7 @@ class links_admin_form_ui extends e_admin_form_ui
foreach($array as $val) foreach($array as $val)
{ {
$newkey = $cat.'::'.$val['function']; $newkey = $cat.'::'.$val['function'];
$func[$newkey] = $val['name']; $func[$newkey] = $tp->toHtml($val['name'],'','TITLE');
} }
$this->linkFunctions[$cat] = $func; $this->linkFunctions[$cat] = $func;
} }

View File

@ -794,7 +794,7 @@ class e107plugin
} }
} }
function manage_link($action, $link_url, $link_name, $link_class = 0) function manage_link($action, $link_url, $link_name, $link_class = 0, $options=array())
{ {
$sql = e107::getDb(); $sql = e107::getDb();
@ -817,6 +817,7 @@ class e107plugin
$link_name = $tp->toDB($link_name, true); $link_name = $tp->toDB($link_name, true);
$path = str_replace("../", "", $link_url); // This should clean up 'non-standard' links $path = str_replace("../", "", $link_url); // This should clean up 'non-standard' links
$path = $tp->createConstants($path); // Add in standard {e_XXXX} directory constants if we can $path = $tp->createConstants($path); // Add in standard {e_XXXX} directory constants if we can
if ($action == 'add') if ($action == 'add')
{ {
$link_t = $sql->db_Count('links'); $link_t = $sql->db_Count('links');
@ -832,7 +833,7 @@ class e107plugin
'link_parent' => '0', 'link_parent' => '0',
'link_open' => '0', 'link_open' => '0',
'link_class' => vartrue($linkclass,'0'), 'link_class' => vartrue($linkclass,'0'),
'link_function' => '' 'link_function' => (vartrue($options['link_function']) ? $this->plugFolder ."::".$options['link_function'] : "")
); );
return $sql->db_Insert('links', $linkData); // TODO: Add the _FIELD_DEFS array return $sql->db_Insert('links', $linkData); // TODO: Add the _FIELD_DEFS array
} }
@ -1647,11 +1648,15 @@ class e107plugin
foreach ($array['link'] as $link) foreach ($array['link'] as $link)
{ {
$attrib = $link['@attributes']; $attrib = $link['@attributes'];
$linkName = (defset($link['@value'])) ? constant($link['@value']) : $link['@value']; $linkName = (defset($link['@value'])) ? constant($link['@value']) : $link['@value'];
$remove = (varset($attrib['deprecate']) == 'true') ? TRUE : FALSE; $remove = (varset($attrib['deprecate']) == 'true') ? TRUE : FALSE;
$url = $attrib['url']; $url = vartrue($attrib['url']);
$perm = (isset($attrib['perm']) ? $attrib['perm'] : 'everyone'); $perm = vartrue($attrib['perm'],'everyone');
$options = array(
'link_function'=>vartrue($attrib['function'])
);
switch ($function) switch ($function)
{ {
@ -1660,7 +1665,7 @@ class e107plugin
if (!$remove) // Add any non-deprecated link if (!$remove) // Add any non-deprecated link
{ {
$result = $this->manage_link('add', $url, $linkName, $perm); $result = $this->manage_link('add', $url, $linkName, $perm, $options);
if($result !== NULL) if($result !== NULL)
{ {
$status = ($result) ? E_MESSAGE_SUCCESS : E_MESSAGE_ERROR; $status = ($result) ? E_MESSAGE_SUCCESS : E_MESSAGE_ERROR;
@ -1670,7 +1675,7 @@ class e107plugin
if ($function == 'upgrade' && $remove) //remove inactive links on upgrade if ($function == 'upgrade' && $remove) //remove inactive links on upgrade
{ {
$status = ($this->manage_link('remove', $url, $linkName)) ? E_MESSAGE_SUCCESS : E_MESSAGE_ERROR; $status = ($this->manage_link('remove', $url, $linkName,false, $options)) ? E_MESSAGE_SUCCESS : E_MESSAGE_ERROR;
$mes->add("Removing Link: {$linkName} with url [{$url}]", $status); $mes->add("Removing Link: {$linkName} with url [{$url}]", $status);
} }
break; break;

View File

@ -2,7 +2,7 @@
if (!defined('e107_INIT')) { exit; } if (!defined('e107_INIT')) { exit; }
e107::css('faqs','faqs.css');
echo '<link rel="stylesheet" href="'.e_PLUGIN_ABS.'faqs/faqs.css" type="text/css" />'; // echo '<link rel="stylesheet" href="'.e_PLUGIN_ABS.'faqs/faqs.css" type="text/css" />';
?> ?>

View File

@ -31,9 +31,8 @@ class faqs_sitelinks // include plugin-folder in the name.
$links = array(); $links = array();
$links[] = array( $links[] = array(
'name' => "FAQ Categories", 'name' => LAN_PLUGIN_FAQS_FUNCTIONNAME, // "FAQ Categories",
'function' => "faqCategories", 'function' => "faqCategories"
'description' => "FAQ Category links"
); );
@ -45,6 +44,7 @@ class faqs_sitelinks // include plugin-folder in the name.
function faqCategories() function faqCategories()
{ {
$sql = e107::getDb(); $sql = e107::getDb();
$tp = e107::getParser();
$sublinks = array(); $sublinks = array();
$sql->db_Select("faqs_info","*","faq_info_id != '' ORDER BY faq_info_order"); $sql->db_Select("faqs_info","*","faq_info_id != '' ORDER BY faq_info_order");
@ -52,7 +52,7 @@ class faqs_sitelinks // include plugin-folder in the name.
while($row = $sql->db_Fetch()) while($row = $sql->db_Fetch())
{ {
$sublinks[] = array( $sublinks[] = array(
'link_name' => $row['faq_info_title'], 'link_name' => $tp->toHtml($row['faq_info_title'],'','TITLE'),
'link_url' => '{e_PLUGIN}faqs/faqs.php?cat.'.$row['faq_info_id'], 'link_url' => '{e_PLUGIN}faqs/faqs.php?cat.'.$row['faq_info_id'],
'link_description' => $row['faq_info_about'], 'link_description' => $row['faq_info_about'],
'link_button' => '', 'link_button' => '',

View File

@ -2,17 +2,12 @@
/* /*
* e107 website system * e107 website system
* *
* Copyright (c) 2008-2009 e107 Inc (e107.org) * Copyright (c) 2008-2013 e107 Inc (e107.org)
* Released under the terms and conditions of the * Released under the terms and conditions of the
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt) * GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
* *
* Custom FAQ install/uninstall/update routines * Custom FAQ install/uninstall/update routines
* *
* $Source: /cvs_backup/e107_0.8/e107_plugins/faqs/faqs_setup.php,v $
* $Revision$
* $Date$
* $Author$
*
*/ */
class faqs_setup class faqs_setup
@ -40,7 +35,7 @@ class faqs_setup
$query2 = "INSERT INTO #faqs_info (`faq_info_id`, `faq_info_title`, `faq_info_about`, `faq_info_parent`, `faq_info_class`, `faq_info_order`, `faq_info_icon`) VALUES $query2 = "INSERT INTO #faqs_info (`faq_info_id`, `faq_info_title`, `faq_info_about`, `faq_info_parent`, `faq_info_class`, `faq_info_order`, `faq_info_icon`) VALUES
(1, 'General', 'General FaQS', 0, 0, 0, ''), (1, 'General', 'General Faqs', 0, 0, 0, ''),
(2, 'Misc', 'Other FAQs', 0, 0, 1, '');"; (2, 'Misc', 'Other FAQs', 0, 0, 1, '');";
$status = ($sql->db_Select_gen($query2)) ? E_MESSAGE_SUCCESS : E_MESSAGE_ERROR; $status = ($sql->db_Select_gen($query2)) ? E_MESSAGE_SUCCESS : E_MESSAGE_ERROR;

View File

@ -9,7 +9,7 @@
<link url='admin_config.php' description='Configure FAQs' icon='images/icon_32.png' iconSmall='images/icon_16.png' primary='true' >LAN_PLUGIN_FAQS_NAME</link> <link url='admin_config.php' description='Configure FAQs' icon='images/icon_32.png' iconSmall='images/icon_16.png' primary='true' >LAN_PLUGIN_FAQS_NAME</link>
</adminLinks> </adminLinks>
<siteLinks> <siteLinks>
<link url='{e_PLUGIN}faqs/faqs.php' description='FAQs' icon='images/icon_32.png' iconSmall='images/icon_16.png'>LAN_PLUGIN_FAQS_NAME</link> <link url='{e_PLUGIN}faqs/faqs.php' description='FAQs' icon='images/icon_32.png' iconSmall='images/icon_16.png' function="faqCategories">LAN_PLUGIN_FAQS_NAME</link>
</siteLinks> </siteLinks>
<pluginPrefs> <pluginPrefs>
<pref name="add_faq">255</pref> <pref name="add_faq">255</pref>

View File

@ -130,14 +130,7 @@ define('LAN_LW_HELP_02','Define the words which become clickable links, or which
Defines which options are active. Defines which options are active.
'); ');
// Admin log related
define('LAN_AL_LINKWD_00', 'Linkword-related message');
define('LAN_AL_LINKWD_01', 'Linkword Added');
define('LAN_AL_LINKWD_02', 'Linkword Edited');
define('LAN_AL_LINKWD_03', 'Linkword deleted');
define('LAN_AL_LINKWD_04', 'Linkword options updated');
define('LAN_AL_LINKWD_05', 'Linkwords version update'); // Used in 0.7-compatible stub only
define('LAN_AL_LINKWD_06', '');

View File

@ -0,0 +1,13 @@
<?php
// Admin log related
define('LAN_AL_LINKWD_00', 'Linkword-related message');
define('LAN_AL_LINKWD_01', 'Linkword Added');
define('LAN_AL_LINKWD_02', 'Linkword Edited');
define('LAN_AL_LINKWD_03', 'Linkword deleted');
define('LAN_AL_LINKWD_04', 'Linkword options updated');
define('LAN_AL_LINKWD_05', 'Linkwords version update'); // Used in 0.7-compatible stub only
define('LAN_AL_LINKWD_06', '');
?>