mirror of
https://github.com/e107inc/e107.git
synced 2025-08-04 21:57:51 +02:00
Plugin category 'menu' added - for menu only installs. (while supporting e_xxxx). siteinfo_shortcodes.php moved to siteinfo plugin: e_shortcode.php
This commit is contained in:
@@ -11,8 +11,8 @@
|
|||||||
| GNU General Public License (http://gnu.org).
|
| GNU General Public License (http://gnu.org).
|
||||||
|
|
|
|
||||||
| $Source: /cvs_backup/e107_0.8/e107_admin/plugin.php,v $
|
| $Source: /cvs_backup/e107_0.8/e107_admin/plugin.php,v $
|
||||||
| $Revision: 1.43 $
|
| $Revision: 1.44 $
|
||||||
| $Date: 2009-09-10 15:39:09 $
|
| $Date: 2009-09-19 17:43:18 $
|
||||||
| $Author: e107coders $
|
| $Author: e107coders $
|
||||||
+----------------------------------------------------------------------------+
|
+----------------------------------------------------------------------------+
|
||||||
*/
|
*/
|
||||||
@@ -755,6 +755,7 @@ class pluginManager{
|
|||||||
|
|
||||||
if (empty($pluginList)) return '';
|
if (empty($pluginList)) return '';
|
||||||
|
|
||||||
|
|
||||||
$text = "";
|
$text = "";
|
||||||
|
|
||||||
foreach($pluginList as $plug)
|
foreach($pluginList as $plug)
|
||||||
@@ -770,6 +771,12 @@ class pluginManager{
|
|||||||
{
|
{
|
||||||
$plug_vars = $plugin->plug_vars;
|
$plug_vars = $plugin->plug_vars;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(varset($plug['plugin_category']) == "menu") // Hide "Menu Only" plugins.
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if($plug_vars)
|
if($plug_vars)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@@ -1,92 +0,0 @@
|
|||||||
<?php
|
|
||||||
/*
|
|
||||||
* Copyright e107 Inc e107.org, Licensed under GNU GPL (http://www.gnu.org/licenses/gpl.txt)
|
|
||||||
* $Id: siteinfo_shortcodes.php,v 1.5 2009-07-25 07:54:34 marj_nl_fr Exp $
|
|
||||||
*
|
|
||||||
* Siteinfo shortcode batch
|
|
||||||
*/
|
|
||||||
if (!defined('e107_INIT')) { exit; }
|
|
||||||
|
|
||||||
$codes = array('sitebutton', 'sitedisclaimer', 'sitename', 'sitedescription', 'sitetag', 'logo', 'theme_disclaimer');
|
|
||||||
register_shortcode('siteinfo_shortcodes', $codes);
|
|
||||||
|
|
||||||
class siteinfo_shortcodes
|
|
||||||
{
|
|
||||||
function sc_sitebutton()
|
|
||||||
{
|
|
||||||
$e107 = e107::getInstance();
|
|
||||||
$path = ($_POST['sitebutton'] && $_POST['ajax_used']) ? $e107->tp->replaceConstants($_POST['sitebutton']) : (strstr(SITEBUTTON, 'http:') ? SITEBUTTON : e_IMAGE.SITEBUTTON);
|
|
||||||
//TODO use CSS class?
|
|
||||||
return '<a href="'.SITEURL.'"><img src="'.$path.'" alt="'.SITENAME.'" /></a>';
|
|
||||||
}
|
|
||||||
|
|
||||||
function sc_sitedisclaimer()
|
|
||||||
{
|
|
||||||
$e107 = e107::getInstance();
|
|
||||||
return $e107->tp->toHtml(SITEDISCLAIMER, true, 'constants defs');
|
|
||||||
}
|
|
||||||
|
|
||||||
function sc_sitename($parm)
|
|
||||||
{
|
|
||||||
return ($parm == 'link') ? "<a href='".SITEURL."' title=\"".SITENAME."\">".SITENAME."</a>" : SITENAME;
|
|
||||||
}
|
|
||||||
|
|
||||||
function sc_sitedescription()
|
|
||||||
{
|
|
||||||
global $pref;
|
|
||||||
return SITEDESCRIPTION.(defined('THEME_DESCRIPTION') && $pref['displaythemeinfo'] ? THEME_DESCRIPTION : '');
|
|
||||||
}
|
|
||||||
|
|
||||||
function sc_sitetag()
|
|
||||||
{
|
|
||||||
return SITETAG;
|
|
||||||
}
|
|
||||||
|
|
||||||
function sc_logo($parm)
|
|
||||||
{
|
|
||||||
parse_str($parm); // Optional {LOGO=file=file_name} or {LOGO=link=url} or {LOGO=file=file_name&link=url}
|
|
||||||
// Paths to image file, link are relative to site base
|
|
||||||
|
|
||||||
if (isset($file) && $file && is_readable($file))
|
|
||||||
{
|
|
||||||
$logo = e_HTTP.$file; // HTML path
|
|
||||||
$path = e_BASE.$file; // PHP path
|
|
||||||
}
|
|
||||||
else if (is_readable(THEME.'images/e_logo.png'))
|
|
||||||
{
|
|
||||||
$logo = THEME_ABS.'images/e_logo.png'; // HTML path
|
|
||||||
$path = THEME.'images/e_logo.png'; // PHP path
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$logo = e_IMAGE_ABS.'logo.png'; // HTML path
|
|
||||||
$path = e_IMAGE.'logo.png'; // PHP path
|
|
||||||
}
|
|
||||||
|
|
||||||
$dimensions = getimagesize($path);
|
|
||||||
|
|
||||||
$image = "<img class='logo' src='".$logo."' style='width: ".$dimensions[0]."px; height: ".$dimensions[1]."px' alt='".SITENAME."' />\n";
|
|
||||||
|
|
||||||
if (isset($link) && $link)
|
|
||||||
{
|
|
||||||
if ($link == 'index')
|
|
||||||
{
|
|
||||||
$image = "<a href='".e_HTTP."index.php'>".$image."</a>";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$image = "<a href='".e_HTTP.$link."'>".$image."</a>";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return $image;
|
|
||||||
}
|
|
||||||
|
|
||||||
function sc_theme_disclaimer($parm)
|
|
||||||
{
|
|
||||||
global $pref;
|
|
||||||
return (defined('THEME_DISCLAIMER') && $pref['displaythemeinfo'] ? THEME_DISCLAIMER : '');
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
?>
|
|
@@ -10,9 +10,9 @@
|
|||||||
| GNU General Public License (http://gnu.org).
|
| GNU General Public License (http://gnu.org).
|
||||||
|
|
|
|
||||||
| $Source: /cvs_backup/e107_0.8/e107_handlers/menumanager_class.php,v $
|
| $Source: /cvs_backup/e107_0.8/e107_handlers/menumanager_class.php,v $
|
||||||
| $Revision: 1.7 $
|
| $Revision: 1.8 $
|
||||||
| $Date: 2009-08-25 08:29:47 $
|
| $Date: 2009-09-19 17:43:19 $
|
||||||
| $Author: secretr $
|
| $Author: e107coders $
|
||||||
+----------------------------------------------------------------------------+
|
+----------------------------------------------------------------------------+
|
||||||
*/
|
*/
|
||||||
if (!defined('e107_INIT')) { exit; }
|
if (!defined('e107_INIT')) { exit; }
|
||||||
@@ -355,6 +355,7 @@ class e_menuManager {
|
|||||||
$efile = new e_file;
|
$efile = new e_file;
|
||||||
$efile->dirFilter = array('/', 'CVS', '.svn', 'languages');
|
$efile->dirFilter = array('/', 'CVS', '.svn', 'languages');
|
||||||
$fileList = $efile->get_files(e_PLUGIN,"_menu\.php$",'standard',2);
|
$fileList = $efile->get_files(e_PLUGIN,"_menu\.php$",'standard',2);
|
||||||
|
|
||||||
foreach($fileList as $file)
|
foreach($fileList as $file)
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -365,7 +366,7 @@ class e_menuManager {
|
|||||||
$existing_menu = $sql->db_Count("menus", "(*)", "WHERE menu_name='{$file['fname']}'");
|
$existing_menu = $sql->db_Count("menus", "(*)", "WHERE menu_name='{$file['fname']}'");
|
||||||
if (file_exists(e_PLUGIN.$parent_dir.'/plugin.xml') || file_exists(e_PLUGIN.$parent_dir.'/plugin.php'))
|
if (file_exists(e_PLUGIN.$parent_dir.'/plugin.xml') || file_exists(e_PLUGIN.$parent_dir.'/plugin.php'))
|
||||||
{
|
{
|
||||||
if (plugInstalled($parent_dir))
|
if (e107::isInstalled($parent_dir))
|
||||||
{ // Its a 'new style' plugin with a plugin.php file, or an even newer one with plugin.xml file - only include if plugin installed
|
{ // Its a 'new style' plugin with a plugin.php file, or an even newer one with plugin.xml file - only include if plugin installed
|
||||||
$valid_menu = TRUE; // Whether new or existing, include in list
|
$valid_menu = TRUE; // Whether new or existing, include in list
|
||||||
// echo "Include {$parent_dir}:{$file['fname']}<br />";
|
// echo "Include {$parent_dir}:{$file['fname']}<br />";
|
||||||
|
@@ -11,8 +11,8 @@
|
|||||||
| GNU General Public License (http://gnu.org).
|
| GNU General Public License (http://gnu.org).
|
||||||
|
|
|
|
||||||
| $Source: /cvs_backup/e107_0.8/e107_handlers/plugin_class.php,v $
|
| $Source: /cvs_backup/e107_0.8/e107_handlers/plugin_class.php,v $
|
||||||
| $Revision: 1.89 $
|
| $Revision: 1.90 $
|
||||||
| $Date: 2009-09-18 23:14:00 $
|
| $Date: 2009-09-19 17:43:19 $
|
||||||
| $Author: e107coders $
|
| $Author: e107coders $
|
||||||
+----------------------------------------------------------------------------+
|
+----------------------------------------------------------------------------+
|
||||||
*/
|
*/
|
||||||
@@ -87,7 +87,7 @@ class e107plugin
|
|||||||
'plugin_category' // Plugin Category: settings, users, content, management, tools, misc, about
|
'plugin_category' // Plugin Category: settings, users, content, management, tools, misc, about
|
||||||
);
|
);
|
||||||
|
|
||||||
var $accepted_categories = array('settings', 'users', 'content', 'tools', 'manage', 'misc', 'about');
|
var $accepted_categories = array('settings', 'users', 'content', 'tools', 'manage', 'misc', 'menu', 'about');
|
||||||
|
|
||||||
var $plug_vars;
|
var $plug_vars;
|
||||||
var $current_plug;
|
var $current_plug;
|
||||||
|
@@ -9,8 +9,8 @@
|
|||||||
* e107 Shortcode handler
|
* e107 Shortcode handler
|
||||||
*
|
*
|
||||||
* $Source: /cvs_backup/e107_0.8/e107_handlers/shortcode_handler.php,v $
|
* $Source: /cvs_backup/e107_0.8/e107_handlers/shortcode_handler.php,v $
|
||||||
* $Revision: 1.30 $
|
* $Revision: 1.31 $
|
||||||
* $Date: 2009-09-18 22:20:39 $
|
* $Date: 2009-09-19 17:43:19 $
|
||||||
* $Author: e107coders $
|
* $Author: e107coders $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -129,11 +129,25 @@ class e_shortcode
|
|||||||
|
|
||||||
function e_shortcode($noload=false)
|
function e_shortcode($noload=false)
|
||||||
{
|
{
|
||||||
global $pref, $register_sc;
|
global $pref;
|
||||||
|
|
||||||
$this->parseSCFiles = true; // Default probably never used, but make sure its defined.
|
$this->parseSCFiles = true; // Default probably never used, but make sure its defined.
|
||||||
|
|
||||||
|
$this->loadOverrideShortcodes();
|
||||||
|
$this->loadThemeShortcodes();
|
||||||
|
$this->loadPluginShortcodes();
|
||||||
|
$this->loadPluginSCFiles();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Register any shortcode from the shortcode/override/ directory
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
protected function loadOverrideShortcodes()
|
||||||
|
{
|
||||||
|
$pref = e107::getConfig('core')->getPref();
|
||||||
|
|
||||||
//Register any shortcode from the shortcode/override/ directory
|
|
||||||
if(varset($pref['sc_override']))
|
if(varset($pref['sc_override']))
|
||||||
{
|
{
|
||||||
$tmp = explode(',', $pref['sc_override']);
|
$tmp = explode(',', $pref['sc_override']);
|
||||||
@@ -144,9 +158,17 @@ class e_shortcode
|
|||||||
$this->scOverride[] = $code;
|
$this->scOverride[] = $code;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Register any shortcodes that were registered by the theme
|
||||||
|
* $register_sc[] = 'MY_THEME_CODE'
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
protected function loadThemeShortcodes()
|
||||||
|
{
|
||||||
|
global $register_sc;
|
||||||
|
|
||||||
// Register any shortcodes that were registered by the theme
|
|
||||||
// $register_sc[] = 'MY_THEME_CODE'
|
|
||||||
if(isset($register_sc) && is_array($register_sc))
|
if(isset($register_sc) && is_array($register_sc))
|
||||||
{
|
{
|
||||||
foreach($register_sc as $code)
|
foreach($register_sc as $code)
|
||||||
@@ -158,11 +180,17 @@ class e_shortcode
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
$this->loadPluginShortcodes();
|
/**
|
||||||
|
* Register all .sc files found in plugin directories (via pref)
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
protected function loadPluginSCFiles()
|
||||||
|
{
|
||||||
|
$pref = e107::getConfig('core')->getPref();
|
||||||
|
|
||||||
// Register all .sc files found in plugin directories (via pref)
|
|
||||||
if(varset($pref['shortcode_list'], '') != '')
|
if(varset($pref['shortcode_list'], '') != '')
|
||||||
{
|
{
|
||||||
foreach($pref['shortcode_list'] as $path => $namearray)
|
foreach($pref['shortcode_list'] as $path => $namearray)
|
||||||
@@ -187,12 +215,15 @@ class e_shortcode
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Load Plugin Shortcode Batch files (e_shortcode.php) for use site-wide.
|
* Register Plugin Shortcode Batch files (e_shortcode.php) for use site-wide.
|
||||||
* Equivalent to multiple .sc files in the plugin's folder.
|
* Equivalent to multiple .sc files in the plugin's folder.
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
function loadPluginShortcodes()
|
protected function loadPluginShortcodes()
|
||||||
{
|
{
|
||||||
$pref = e107::getConfig('core')->getPref();
|
$pref = e107::getConfig('core')->getPref();
|
||||||
|
|
||||||
@@ -203,7 +234,7 @@ class e_shortcode
|
|||||||
|
|
||||||
foreach($pref['e_shortcode_list'] as $key=>$val)
|
foreach($pref['e_shortcode_list'] as $key=>$val)
|
||||||
{
|
{
|
||||||
if(!e107::isInstalled($key) || !include_once(e_PLUGIN.$key.'/e_shortcode.php'))
|
if(!include_once(e_PLUGIN.$key.'/e_shortcode.php'))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -227,9 +258,13 @@ class e_shortcode
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Register Core Shortcode Batches.
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
function loadCoreShortcodes()
|
function loadCoreShortcodes()
|
||||||
{
|
{
|
||||||
$coreBatchList = array('siteinfo_shortcodes.php', 'admin_shortcodes.php');
|
$coreBatchList = array('admin_shortcodes.php');
|
||||||
foreach($coreBatchList as $cb)
|
foreach($coreBatchList as $cb)
|
||||||
{
|
{
|
||||||
include_once(e_FILE.'shortcode/batch/'.$cb);
|
include_once(e_FILE.'shortcode/batch/'.$cb);
|
||||||
|
Reference in New Issue
Block a user