mirror of
https://github.com/e107inc/e107.git
synced 2025-01-17 20:58:30 +01:00
featurebox front-end - dynamic (AJAX) loading added, the rest is only theme styling; working examples in jayya and _blank (better one)
This commit is contained in:
parent
52d9d13d3f
commit
abc0d5a7c6
@ -1,36 +1,33 @@
|
||||
<?php
|
||||
/*
|
||||
+ ----------------------------------------------------------------------------+
|
||||
|| e107 website system
|
||||
|
|
||||
| Copyright (C) 2008-2009 e107 Inc (e107.org)
|
||||
| http://e107.org
|
||||
|
|
||||
|
|
||||
| Released under the terms and conditions of the
|
||||
| GNU General Public License (http://gnu.org).
|
||||
|
|
||||
| $Source: /cvs_backup/e107_0.8/e107_files/e_ajax.php,v $
|
||||
| $Revision: 1.8 $
|
||||
| $Date: 2009-11-18 01:04:42 $
|
||||
| $Author: e107coders $
|
||||
+----------------------------------------------------------------------------+
|
||||
* 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)
|
||||
*
|
||||
* Call Shortcodes via AJAX request
|
||||
*
|
||||
* $Source: /cvs_backup/e107_0.8/e107_files/e_ajax.php,v $
|
||||
* $Revision: 1.9 $
|
||||
* $Date: 2009-12-10 22:46:45 $
|
||||
* $Author: secretr $
|
||||
*
|
||||
*/
|
||||
$_E107['minimal'] = TRUE;
|
||||
require_once("../class2.php");
|
||||
//ob_start();
|
||||
ob_implicit_flush(0);
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// Ajax Short-code-Replacer Routine.
|
||||
|
||||
$shortcodes = "";
|
||||
// FIXME - new .php shortcodes & security (require_once)
|
||||
if($_POST['ajax_sc'] && $_POST['ajax_scfile'])
|
||||
{
|
||||
include_once(e_HANDLER.'shortcode_handler.php');
|
||||
$file = $tp->replaceConstants($_POST['ajax_scfile']);
|
||||
$shortcodes = $tp -> e_sc -> parse_scbatch($file);
|
||||
//include_once(e_HANDLER.'shortcode_handler.php');
|
||||
$file = e107::getParser()->replaceConstants($_POST['ajax_scfile']);
|
||||
$shortcodes = e107::getScParser()->parse_scbatch($file);
|
||||
}
|
||||
|
||||
if(vartrue($_POST['ajax_sc']) && e_AJAX_REQUEST)
|
||||
|
@ -9,9 +9,9 @@
|
||||
* Unobtrusive JS support
|
||||
*
|
||||
* $Source: /cvs_backup/e107_0.8/e107_files/e_css.php,v $
|
||||
* $Revision: 1.4 $
|
||||
* $Date: 2009-11-18 01:04:43 $
|
||||
* $Author: e107coders $
|
||||
* $Revision: 1.5 $
|
||||
* $Date: 2009-12-10 22:46:45 $
|
||||
* $Author: secretr $
|
||||
*/
|
||||
if (!defined('e107_INIT')) { exit; }
|
||||
// No JavaScript support using CSS
|
||||
@ -40,7 +40,9 @@ echo "
|
||||
button.e-hide-if-js { display: inline; }
|
||||
</style>
|
||||
<script type='text/javascript'>
|
||||
$('e-js-css').disabled=true;
|
||||
//$('e-js-css').disabled=true;
|
||||
// 'disabled' is not valid style attribute, fails with Konqueror (tested on Fedora)
|
||||
$('e-js-css').remove();
|
||||
</script>
|
||||
";
|
||||
?>
|
@ -9,8 +9,8 @@
|
||||
* e107 Main
|
||||
*
|
||||
* $Source: /cvs_backup/e107_0.8/e107_handlers/e107_class.php,v $
|
||||
* $Revision: 1.90 $
|
||||
* $Date: 2009-12-09 18:33:43 $
|
||||
* $Revision: 1.91 $
|
||||
* $Date: 2009-12-10 22:46:45 $
|
||||
* $Author: secretr $
|
||||
*/
|
||||
|
||||
@ -1369,7 +1369,7 @@ class e107
|
||||
return self::getRegistry($regPath);
|
||||
}
|
||||
$ret = self::getRegistry($regPath);
|
||||
return ($ret && is_array($ret) && isset($ret[$key]) ? $ret[$key] : $ret);
|
||||
return ($ret && is_array($ret) && isset($ret[$key]) ? $ret[$key] : (is_array($ret) ? array() : ''));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -7,9 +7,9 @@
|
||||
* GNU General Public License (http://gnu.org).
|
||||
*
|
||||
* $Source: /cvs_backup/e107_0.8/e107_handlers/js_manager.php,v $
|
||||
* $Revision: 1.7 $
|
||||
* $Date: 2009-11-18 01:49:18 $
|
||||
* $Author: marj_nl_fr $
|
||||
* $Revision: 1.8 $
|
||||
* $Date: 2009-12-10 22:46:45 $
|
||||
* $Author: secretr $
|
||||
*
|
||||
*/
|
||||
global $pref, $eplug_admin, $THEME_JSLIB, $THEME_CORE_JSLIB;
|
||||
@ -443,6 +443,11 @@ class e_jsmanager
|
||||
{
|
||||
foreach ($file_path as $fp => $loc)
|
||||
{
|
||||
if(is_numeric($fp))
|
||||
{
|
||||
$fp = $loc;
|
||||
$loc = $runtime_location;
|
||||
}
|
||||
$this->addJs($type, $fp, $loc);
|
||||
}
|
||||
return $this;
|
||||
@ -698,6 +703,8 @@ class e_jsmanager
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
$js_content_array = array_unique($js_content_array); //TODO quick fix, we need better control!
|
||||
echo "\n";
|
||||
if($label) //TODO - print comments only if site debug is on
|
||||
{
|
||||
|
@ -9,8 +9,8 @@
|
||||
* e107 Base Model
|
||||
*
|
||||
* $Source: /cvs_backup/e107_0.8/e107_handlers/model_class.php,v $
|
||||
* $Revision: 1.47 $
|
||||
* $Date: 2009-12-08 17:21:33 $
|
||||
* $Revision: 1.48 $
|
||||
* $Date: 2009-12-10 22:46:45 $
|
||||
* $Author: secretr $
|
||||
*/
|
||||
|
||||
@ -2107,7 +2107,6 @@ class e_tree_model extends e_model
|
||||
{
|
||||
// TODO - $sql->total_results variable type!!!
|
||||
$this->_total = is_integer($sql->total_results) ? $sql->total_results : false; //requires SQL_CALC_FOUND_ROWS in query - see db handler
|
||||
|
||||
while($tmp = $sql->db_Fetch())
|
||||
{
|
||||
$tmp = new $class_name($tmp);
|
||||
|
@ -9,8 +9,8 @@
|
||||
* mySQL Handler
|
||||
*
|
||||
* $Source: /cvs_backup/e107_0.8/e107_handlers/mysql_class.php,v $
|
||||
* $Revision: 1.68 $
|
||||
* $Date: 2009-12-02 16:51:00 $
|
||||
* $Revision: 1.69 $
|
||||
* $Date: 2009-12-10 22:46:46 $
|
||||
* $Author: secretr $
|
||||
*/
|
||||
|
||||
@ -51,30 +51,33 @@ $db_ConnectionID = NULL; // Stores ID for the first DB connection used - which s
|
||||
*
|
||||
* @package e107
|
||||
* @category e107_handlers
|
||||
* @version $Revision: 1.68 $
|
||||
* @version $Revision: 1.69 $
|
||||
* @author $Author: secretr $
|
||||
*
|
||||
*/
|
||||
class e_db_mysql {
|
||||
|
||||
var $mySQLserver;
|
||||
var $mySQLuser;
|
||||
var $mySQLpassword;
|
||||
var $mySQLdefaultdb;
|
||||
var $mySQLPrefix;
|
||||
var $mySQLaccess;
|
||||
var $mySQLresult;
|
||||
var $mySQLrows;
|
||||
var $mySQLerror = ''; // Error reporting mode - TRUE shows messages
|
||||
var $mySQLlastErrNum = 0; // Number of last error
|
||||
var $mySQLlastErrText; // Text of last error (empty string if no error)
|
||||
var $mySQLcurTable;
|
||||
var $mySQLlanguage;
|
||||
var $mySQLinfo;
|
||||
var $tabset;
|
||||
var $mySQLtableList = array(); // list of all Db tables.
|
||||
// TODO switch to protected vars where needed
|
||||
public $mySQLserver;
|
||||
public $mySQLuser;
|
||||
public $mySQLpassword;
|
||||
public $mySQLdefaultdb;
|
||||
public $mySQLPrefix;
|
||||
public $mySQLaccess;
|
||||
public $mySQLresult;
|
||||
public $mySQLrows;
|
||||
public $mySQLerror = ''; // Error reporting mode - TRUE shows messages
|
||||
|
||||
protected $mySQLlastErrNum = 0; // Number of last error - now protected, use getLastErrNum()
|
||||
protected $mySQLlastErrText = ''; // Text of last error - now protected, use getLastErrText()
|
||||
|
||||
public $mySQLcurTable;
|
||||
public $mySQLlanguage;
|
||||
public $mySQLinfo;
|
||||
public $tabset;
|
||||
public $mySQLtableList = array(); // list of all Db tables.
|
||||
|
||||
var $mySQLtableListLanguage = array(); // Db table list for the currently selected language
|
||||
public $mySQLtableListLanguage = array(); // Db table list for the currently selected language
|
||||
|
||||
/**
|
||||
* MySQL Charset
|
||||
@ -83,7 +86,7 @@ class e_db_mysql {
|
||||
*/
|
||||
public $mySQLcharset;
|
||||
|
||||
var $total_results; // Total number of results
|
||||
public $total_results = false; // Total number of results
|
||||
|
||||
/**
|
||||
* Constructor - gets language options from the cookie or session
|
||||
@ -264,12 +267,13 @@ class e_db_mysql {
|
||||
$db_time += $mytime;
|
||||
$this->mySQLresult = $sQryRes;
|
||||
|
||||
$this->total_results = false;
|
||||
if ((strpos($query,'SQL_CALC_FOUND_ROWS') !== FALSE) && (strpos($query,'SELECT') !== FALSE))
|
||||
{ // Need to get the total record count as well. Return code is a resource identifier
|
||||
// Have to do this before any debug action, otherwise this bit gets messed up
|
||||
$fr = mysql_query('SELECT FOUND_ROWS()', $this->mySQLaccess);
|
||||
$rc = mysql_fetch_array($fr);
|
||||
$this->total_results = $rc['FOUND_ROWS()'];
|
||||
$this->total_results = (int) $rc['FOUND_ROWS()'];
|
||||
}
|
||||
|
||||
if (E107_DEBUG_LEVEL)
|
||||
|
@ -9,8 +9,8 @@
|
||||
* Featurebox administration
|
||||
*
|
||||
* $Source: /cvs_backup/e107_0.8/e107_plugins/featurebox/admin_config.php,v $
|
||||
* $Revision: 1.12 $
|
||||
* $Date: 2009-12-09 18:33:40 $
|
||||
* $Revision: 1.13 $
|
||||
* $Date: 2009-12-10 22:46:45 $
|
||||
* $Author: secretr $
|
||||
*
|
||||
*/
|
||||
@ -160,14 +160,14 @@ class fb_main_ui extends e_admin_ui
|
||||
'fb_id' => array('title'=> LAN_ID, 'type' => 'number', 'data'=> 'int', 'width' =>'5%', 'forced'=> TRUE),
|
||||
'fb_category' => array('title'=> LAN_CATEGORY, 'type' => 'dropdown', 'data'=> 'int', 'width' => '5%', 'filter'=>TRUE, 'batch'=>TRUE),
|
||||
'fb_title' => array('title'=> LAN_TITLE, 'type' => 'text', 'width' => 'auto', 'thclass' => 'left'),
|
||||
'fb_text' => array('title'=> "Message Text", 'type' => 'bbarea', 'width' => '30%', 'readParms' => 'expand=...&truncate=50&bb=1'), // Display name
|
||||
'fb_text' => array('title'=> "Message Text", 'type' => 'bbarea', 'width' => '30%', 'readParms' => 'expand=...&truncate=50&bb=1'),
|
||||
//DEPRECATED 'fb_mode' => array('title'=> FBLAN_12, 'type' => 'dropdown', 'data'=> 'int', 'width' => '5%', 'filter'=>TRUE, 'batch'=>TRUE),
|
||||
//DEPRECATED 'fb_rendertype' => array('title'=> FBLAN_22, 'type' => 'dropdown', 'data'=> 'int', 'width' => 'auto', 'noedit' => TRUE),
|
||||
'fb_template' => array('title'=> FBLAN_25, 'type' => 'layouts', 'data'=> 'str', 'width' => 'auto', 'thclass' => 'center', 'class'=>'center', 'writeParms' => 'plugin=featurebox', 'filter' => true, 'batch' => true), // Photo
|
||||
'fb_image' => array('title'=> "Image", 'type' => 'image', 'width' => 'auto', 'thclass' => 'left first'),
|
||||
'fb_imageurl' => array('title'=> "Image Link", 'type' => 'url', 'width' => 'auto', 'thclass' => 'left first'),
|
||||
'fb_template' => array('title'=> FBLAN_25, 'type' => 'layouts', 'data'=> 'str', 'width' => 'auto', 'writeParms' => 'plugin=featurebox', 'filter' => true, 'batch' => true), // Photo
|
||||
'fb_image' => array('title'=> "Image", 'type' => 'image', 'width' => 'auto'),
|
||||
'fb_imageurl' => array('title'=> "Image Link", 'type' => 'url', 'width' => 'auto'),
|
||||
'fb_class' => array('title'=> LAN_VISIBILITY, 'type' => 'userclass', 'data' => 'int', 'width' => 'auto'), // User id
|
||||
'fb_order' => array('title'=> LAN_ORDER, 'type' => 'number', 'data'=> 'int','width' => '5%', 'thclass' => 'center' ),
|
||||
'fb_order' => array('title'=> LAN_ORDER, 'type' => 'number', 'data'=> 'int','width' => '5%' ),
|
||||
'options' => array('title'=> LAN_OPTIONS, 'type' => null, 'forced'=>TRUE, 'width' => '10%', 'thclass' => 'center last', 'class' => 'center')
|
||||
);
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright (c) e107 Inc 2009 - e107.org, Licensed under GNU GPL (http://www.gnu.org/licenses/gpl.txt)
|
||||
* $Id: e_shortcode.php,v 1.3 2009-12-09 18:33:37 secretr Exp $
|
||||
* $Id: e_shortcode.php,v 1.4 2009-12-10 22:46:45 secretr Exp $
|
||||
*
|
||||
* Featurebox shortcode batch class - shortcodes available site-wide. ie. equivalent to multiple .sc files.
|
||||
*/
|
||||
@ -12,6 +12,8 @@ e107::includeLan(e_PLUGIN.'featurebox/languages/'.e_LANGUAGE.'_front_featurebox.
|
||||
|
||||
class featurebox_shortcodes // must match the plugin's folder name. ie. [PLUGIN_FOLDER]_shortcodes
|
||||
{
|
||||
protected $_categories = array();
|
||||
|
||||
/**
|
||||
* Available parameters (GET string format)
|
||||
* - cols (integer): number of items per column, default 1
|
||||
@ -41,8 +43,7 @@ class featurebox_shortcodes // must match the plugin's folder name. ie. [PLUGIN_
|
||||
|
||||
parse_str($parm, $parm);
|
||||
|
||||
$category = new plugin_featurebox_category();
|
||||
$category->loadByTemplate($ctemplate);
|
||||
$category = $this->getCategoryModel($ctemplate);
|
||||
if(!$category->hasData())
|
||||
{
|
||||
return '';
|
||||
@ -63,6 +64,10 @@ class featurebox_shortcodes // must match the plugin's folder name. ie. [PLUGIN_
|
||||
$counter = 1;
|
||||
$col_counter = 1;
|
||||
$total = count($tree->getTree());
|
||||
$category->setParam('total', $total)
|
||||
->setParam('cols', $cols)
|
||||
->setParam('no_fill_empty', isset($parm['no_fill_empty']) ? 1 : 0);
|
||||
|
||||
foreach ($tree->getTree() as $id => $node)
|
||||
{
|
||||
$tmpl_item = e107::getTemplate('featurebox', 'featurebox', $node->get('fb_template'));
|
||||
@ -94,19 +99,19 @@ class featurebox_shortcodes // must match the plugin's folder name. ie. [PLUGIN_
|
||||
// else add item separator
|
||||
else
|
||||
{
|
||||
$tmpl_item .= $ret['item_separator'];
|
||||
$tmpl_item .= $tmpl['item_separator'];
|
||||
}
|
||||
}
|
||||
// no more items - clean & close
|
||||
else
|
||||
{
|
||||
$empty_cnt = $cols - $col_counter;
|
||||
if($empty_cnt > 0 && !isset($parm['no_fill_empty']))
|
||||
if($empty_cnt > 0 && !$category->getParam('no_fill_empty'))
|
||||
{
|
||||
// empty items fill
|
||||
for ($index = 1; $index <= $empty_cnt; $index++)
|
||||
{
|
||||
$tmpl_item .= $ret['item_separator'].varset($ret['item_empty'], '<div><!-- --></div>');
|
||||
$tmpl_item .= $tmpl['item_separator'].varset($tmpl['item_empty'], '<div><!-- --></div>');
|
||||
}
|
||||
}
|
||||
// add column end
|
||||
@ -114,6 +119,10 @@ class featurebox_shortcodes // must match the plugin's folder name. ie. [PLUGIN_
|
||||
}
|
||||
|
||||
$ret[$counter] = $node->setParam('counter', $counter)
|
||||
->setParam('cols', $cols)
|
||||
->setParam('col_counter', $col_counter)
|
||||
->setParam('limit', $category->get('fb_category_limit'))
|
||||
->setParam('total', $total)
|
||||
->setCategory($category)
|
||||
->toHTML($tmpl_item);
|
||||
|
||||
@ -134,10 +143,8 @@ class featurebox_shortcodes // must match the plugin's folder name. ie. [PLUGIN_
|
||||
/**
|
||||
* Render featurebox navigation
|
||||
* Available parameters (GET string format)
|
||||
* - cols (integer): number of items per column, default 1
|
||||
* - no_fill_empty (boolean): don't fill last column with empty items (if required), default 0
|
||||
* - tablestyle (string): mode to be used with <code>tablerender()</code>, default 'featurebox'
|
||||
* - notablestyle (null): if isset - disable <code>tablerender()</code>
|
||||
* - loop (boolean): loop using 'nav_loop' template, default 0
|
||||
* - base (string): template key prefix, default is 'nav'. Example: 'mynav' base key will search templates 'mynav_start', 'mynav_loop', 'mynav_end'.
|
||||
*
|
||||
* @param string $parm parameters
|
||||
* @param string $mod category template
|
||||
@ -158,16 +165,13 @@ class featurebox_shortcodes // must match the plugin's folder name. ie. [PLUGIN_
|
||||
{
|
||||
$ctemplate = $mod;
|
||||
}
|
||||
|
||||
parse_str($parm, $parm);
|
||||
|
||||
$category = new plugin_featurebox_category();
|
||||
$category->loadByTemplate($ctemplate);
|
||||
$category = $this->getCategoryModel($ctemplate);
|
||||
if(!$category->hasData())
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
$tree = $category->getItemTree();
|
||||
if($tree->isEmpty())
|
||||
{
|
||||
@ -175,6 +179,162 @@ class featurebox_shortcodes // must match the plugin's folder name. ie. [PLUGIN_
|
||||
}
|
||||
|
||||
$tmpl = $this->getFboxTemplate($category);
|
||||
if($category->get('fb_category_random'))
|
||||
{
|
||||
$parm['loop'] = 0;
|
||||
}
|
||||
|
||||
$base = vartrue($parm['base'], 'nav').'_';
|
||||
$ret = $category->toHTML(varset($tmpl[$base.'start']), true);
|
||||
if(isset($parm['loop']) && $tree->getTotal() > 0 && vartrue($tmpl[$base.'item']))
|
||||
{
|
||||
$total = ceil($tree->getTotal() / $category->sc_featurebox_category_limit());
|
||||
$model = clone $category;
|
||||
$tmp = array();
|
||||
for ($index = 1; $index <= $total; $index++)
|
||||
{
|
||||
$tmp[] = $model->setParam('counter', $index)
|
||||
->setParam('active', $index == varset($parm['from'], 1))
|
||||
->toHTML($tmpl[$base.'item'], true);
|
||||
}
|
||||
$ret .= implode(varset($tmpl[$base.'separator']), $tmp);
|
||||
unset($model, $tmp);
|
||||
}
|
||||
$ret .= $category->toHTML(varset($tmpl[$base.'end']), true);
|
||||
|
||||
if(vartrue($tmpl['js']))
|
||||
{
|
||||
e107::getJs()->footerFile(explode(',', $tmpl['js']));
|
||||
}
|
||||
|
||||
if(vartrue($tmpl['js_inline']))
|
||||
{
|
||||
e107::getJs()->footerInline($tmpl['js_inline'], 3);
|
||||
}
|
||||
|
||||
return $ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* Render featurebox navigation
|
||||
* Available parameters (GET string format)
|
||||
* - cols (integer): number of items per column, default 1
|
||||
* - no_fill_empty (boolean): don't fill last column with empty items (if required), default 0
|
||||
* - from (integer): start load at
|
||||
* - limit (integer): load to
|
||||
*
|
||||
* @param string $parm parameters
|
||||
* @param string $mod category template
|
||||
*/
|
||||
function sc_featurebox_items($parm, $mod = '')
|
||||
{
|
||||
// TODO cache
|
||||
if(!e107::isInstalled('featurebox')) //just in case
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
if(!$mod)
|
||||
{
|
||||
$ctemplate = 'default';
|
||||
}
|
||||
else
|
||||
{
|
||||
$ctemplate = $mod;
|
||||
}
|
||||
|
||||
parse_str($parm, $parm);
|
||||
|
||||
$category = clone $this->getCategoryModel($ctemplate);
|
||||
|
||||
if(!$category->hasData())
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
$cols = intval(vartrue($parm['cols'], 1));
|
||||
$limit = intval(varset($parm['limit'], $category->sc_featurebox_category_limit()));
|
||||
$from = (intval(vartrue($parm['from'], 1)) - 1) * $cols;
|
||||
|
||||
$category->setParam('cols', $cols)
|
||||
->setParam('no_fill_empty', isset($parm['no_fill_empty']) ? 1 : 0)
|
||||
->setParam('limit', $limit)
|
||||
->setParam('from', $from);
|
||||
|
||||
$tree = $category->getItemTree(true);
|
||||
if($tree->isEmpty())
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
$total = count($tree->getTree());
|
||||
$category->setParam('total', $total);
|
||||
$counter = 1;
|
||||
$col_counter = 1;
|
||||
$ret = '';
|
||||
foreach ($tree->getTree() as $id => $node)
|
||||
{
|
||||
$tmpl_item = e107::getTemplate('featurebox', 'featurebox', $node->get('fb_template'));
|
||||
if(!$tmpl_item)
|
||||
{
|
||||
$tmpl_item = e107::getTemplate('featurebox', 'featurebox', 'default');
|
||||
}
|
||||
|
||||
// reset column counter
|
||||
if($col_counter > $cols)
|
||||
{
|
||||
$col_counter = 1;
|
||||
}
|
||||
|
||||
// add column start
|
||||
if(1 == $col_counter && vartrue($tmpl['col_start']))
|
||||
{
|
||||
$tmpl_item = $tmpl['col_start'].$tmpl_item;
|
||||
}
|
||||
|
||||
// there is more
|
||||
if(($total - $counter) > 0)
|
||||
{
|
||||
// add column end if column end reached
|
||||
if($cols == $col_counter && vartrue($tmpl['col_end']))
|
||||
{
|
||||
$tmpl_item .= $tmpl['col_end'];
|
||||
}
|
||||
// else add item separator
|
||||
else
|
||||
{
|
||||
$tmpl_item .= $tmpl['item_separator'];
|
||||
}
|
||||
}
|
||||
// no more items - clean & close
|
||||
else
|
||||
{
|
||||
$empty_cnt = $cols - $col_counter;
|
||||
if($empty_cnt > 0 && !$category->getParam('no_fill_empty'))
|
||||
{
|
||||
// empty items fill
|
||||
for ($index = 1; $index <= $empty_cnt; $index++)
|
||||
{
|
||||
$tmpl_item .= $tmpl['item_separator'].varset($tmpl['item_empty'], '<div><!-- --></div>');
|
||||
}
|
||||
}
|
||||
// add column end
|
||||
$tmpl_item .= varset($tmpl['col_end']);
|
||||
}
|
||||
|
||||
$ret .= $node->setParam('counter', $counter)
|
||||
->setParam('cols', $cols)
|
||||
->setParam('col_counter', $col_counter)
|
||||
->setParam('limit', $category->get('fb_category_limit'))
|
||||
->setParam('total', $total)
|
||||
->setCategory($category)
|
||||
->toHTML($tmpl_item);
|
||||
|
||||
|
||||
$counter++;
|
||||
$col_counter++;
|
||||
}
|
||||
return $ret;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -200,4 +360,19 @@ class featurebox_shortcodes // must match the plugin's folder name. ie. [PLUGIN_
|
||||
}
|
||||
return $tmpl;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get category model by template
|
||||
* @param string $template
|
||||
* @return plugin_featurebox_category
|
||||
*/
|
||||
public function getCategoryModel($template, $force = false)
|
||||
{
|
||||
if(!isset($this->_categories[$template]))
|
||||
{
|
||||
$this->_categories[$template] = new plugin_featurebox_category();
|
||||
$this->_categories[$template]->loadByTemplate($template, $force);
|
||||
}
|
||||
return $this->_categories[$template];
|
||||
}
|
||||
}
|
||||
|
128
e107_plugins/featurebox/featurebox.js
Normal file
128
e107_plugins/featurebox/featurebox.js
Normal file
@ -0,0 +1,128 @@
|
||||
/*
|
||||
* 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)
|
||||
*
|
||||
* Featurebox Javascript Class
|
||||
*
|
||||
* $Source: /cvs_backup/e107_0.8/e107_plugins/featurebox/featurebox.js,v $
|
||||
* $Revision: 1.1 $
|
||||
* $Date: 2009-12-10 22:46:45 $
|
||||
* $Author: secretr $
|
||||
*
|
||||
*/
|
||||
|
||||
// Temporary solution, will be moved to e107Widgets
|
||||
var Featurebox = Class.create({
|
||||
|
||||
initialize: function(container, options) {
|
||||
this._container = $(container);
|
||||
if(!this._container) return;
|
||||
|
||||
this.options = Object.extend({
|
||||
'ajax_container': null,
|
||||
'ajax_navbar': null,
|
||||
'ajax_nav_selector': 'a.featurebox-nav-link',
|
||||
'ajax_loader': null,
|
||||
'ajax_hide_onload': false,
|
||||
'continuous': false,
|
||||
'ajax_url': '#{e_FILE}'.parsePath() + 'e_ajax.php'
|
||||
}, options || {});
|
||||
|
||||
this._ajax_container = this.options.ajax_container && $(this.options.ajax_container) ? $(this.options.ajax_container) : this._container.down('.body');
|
||||
this._ajax_navbar = this.options.ajax_navbar && $(this.options.ajax_navbar) ? $(this.options.ajax_navbar) : this._container.down('.featurebox-nav');
|
||||
this._ajax_loader = this.options.ajax_loader && $(this.options.ajax_loader) ? $(this.options.ajax_loader) : this._container.down('.featurebox-loader');
|
||||
this._current = $A();
|
||||
|
||||
if(!this._ajax_container || !this._ajax_navbar) return;
|
||||
this._ajax_nav = this._ajax_navbar.select(this.options.ajax_nav_selector);
|
||||
|
||||
this.clickObserverHandler = this.clickObserver.bindAsEventListener(this);
|
||||
this.nextObserverHandler = this.nextObserver.bindAsEventListener(this);
|
||||
this.prevObserverHandler = this.prevObserver.bindAsEventListener(this);
|
||||
|
||||
this.startObserve();
|
||||
},
|
||||
|
||||
clickObserver: function(event) {
|
||||
var element = event.element('a');
|
||||
event.stop();
|
||||
this.run(element);
|
||||
},
|
||||
|
||||
nextObserver: function(event) {
|
||||
event.stop();
|
||||
var current = this._current[1] ? parseInt(this._current[1]) : 1,
|
||||
next = current >= this._ajax_nav.length ? 0 : current;
|
||||
if(!this.options.continuous && next == 0) return;
|
||||
this.run(this._ajax_nav[next]);
|
||||
},
|
||||
|
||||
prevObserver: function(event) {
|
||||
event.stop();
|
||||
var current = this._current[1] ? parseInt(this._current[1]) : 1,
|
||||
prev = (current - 2) < 0 ? this._ajax_nav.length - 1 : current - 2;
|
||||
if(!this.options.continuous && prev == this._ajax_nav.length - 1) return;
|
||||
this.run(this._ajax_nav[prev]);
|
||||
},
|
||||
|
||||
run: function(element) {
|
||||
var options = element.href.split('#',2)[1].split('.'), that;
|
||||
this._current = options;
|
||||
|
||||
if(element.hasClassName('active')) return;
|
||||
|
||||
this._ajax_navbar.select('.active').invoke('removeClassName', 'active');
|
||||
element.addClassName('active');
|
||||
if(element.up('li')) {
|
||||
element.up('li').addClassName('active'); // only li support at this time
|
||||
}
|
||||
|
||||
this.showLoader();
|
||||
that = this;
|
||||
new e107Ajax.Request(this.options.ajax_url, {
|
||||
parameters: {
|
||||
'ajax_sc': 'featurebox_items|' + varset(options[0], '') + '=from=' + varset(options[1], 0) + '&cols=' + varset(options[2], 0) + '&no_fill_empty=' + varset(options[3], 0)
|
||||
},
|
||||
method: 'post',
|
||||
onComplete: function(transport) {
|
||||
that.hideLoader(transport.responseText);
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
startObserve: function() {
|
||||
this._ajax_navbar.select('a.featurebox-nav-link').invoke('observe', 'click', this.clickObserverHandler);
|
||||
this._ajax_navbar.select('a.featurebox-nav-next').invoke('observe', 'click', this.nextObserverHandler);
|
||||
this._ajax_navbar.select('a.featurebox-nav-prev').invoke('observe', 'click', this.prevObserverHandler);
|
||||
},
|
||||
|
||||
stopObserve: function() {
|
||||
this._ajax_navbar.select('a.featurebox-nav-link').invoke('stopObserving', 'click', this.clickObserverHandler);
|
||||
this._ajax_navbar.select('a.featurebox-nav-next').invoke('stopObserving', 'click', this.nextObserverHandler);
|
||||
this._ajax_navbar.select('a.featurebox-nav-prev').invoke('stopObserving', 'click', this.prevObserverHandler);
|
||||
},
|
||||
|
||||
showLoader: function() {
|
||||
if(this._ajax_loader) {
|
||||
if(this.options.ajax_hide_onload) {
|
||||
this._ajax_container.hide();
|
||||
}
|
||||
this._ajax_loader.show();
|
||||
}
|
||||
this.stopObserve();
|
||||
},
|
||||
|
||||
hideLoader: function(text) {
|
||||
if(this._ajax_loader) {
|
||||
this._ajax_loader.hide();
|
||||
if(this.options.ajax_hide_onload) {
|
||||
this._ajax_container.show();
|
||||
}
|
||||
}
|
||||
this._ajax_container.update(text);
|
||||
this.startObserve();
|
||||
}
|
||||
});
|
@ -9,8 +9,8 @@
|
||||
* Featurebox Category model
|
||||
*
|
||||
* $Source: /cvs_backup/e107_0.8/e107_plugins/featurebox/includes/category.php,v $
|
||||
* $Revision: 1.3 $
|
||||
* $Date: 2009-12-09 18:36:32 $
|
||||
* $Revision: 1.4 $
|
||||
* $Date: 2009-12-10 22:46:45 $
|
||||
* $Author: secretr $
|
||||
*
|
||||
*/
|
||||
@ -78,8 +78,44 @@ class plugin_featurebox_category extends e_model
|
||||
|
||||
public function sc_featurebox_category_template()
|
||||
{
|
||||
return $this->get('');
|
||||
return $this->get('fb_category_template');
|
||||
}
|
||||
|
||||
public function sc_featurebox_category_limit()
|
||||
{
|
||||
return $this->get('fb_category_limit');
|
||||
}
|
||||
|
||||
public function sc_featurebox_category_total()
|
||||
{
|
||||
return $this->getParam('total', 0);
|
||||
}
|
||||
|
||||
public function sc_featurebox_category_all()
|
||||
{
|
||||
return $this->getItemTree()->getTotal();
|
||||
}
|
||||
|
||||
public function sc_featurebox_category_cols()
|
||||
{
|
||||
return $this->getParam('cols', 1);
|
||||
}
|
||||
|
||||
public function sc_featurebox_nav_counter()
|
||||
{
|
||||
return $this->getParam('counter', 1);
|
||||
}
|
||||
|
||||
public function sc_featurebox_nav_active()
|
||||
{
|
||||
return $this->getParam('active') ? ' active' : '';
|
||||
}
|
||||
|
||||
public function sc_featurebox_category_emptyfill()
|
||||
{
|
||||
return $this->getParam('no_fill_empty', 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Load category data by layout
|
||||
* TODO - system cache
|
||||
@ -116,6 +152,7 @@ class plugin_featurebox_category extends e_model
|
||||
$this->_tree = new plugin_featurebox_tree();
|
||||
$options = array(
|
||||
'limit' => $this->getParam('limit', $this->get('fb_category_limit')),
|
||||
'from' => $this->getParam('from', 0),
|
||||
'random' => $this->getParam('random', $this->get('fb_category_random'))
|
||||
);
|
||||
$this->_tree->load($this->getId(), $options, $force);
|
||||
|
@ -9,8 +9,8 @@
|
||||
* Featurebox Item model
|
||||
*
|
||||
* $Source: /cvs_backup/e107_0.8/e107_plugins/featurebox/includes/item.php,v $
|
||||
* $Revision: 1.2 $
|
||||
* $Date: 2009-12-08 17:21:32 $
|
||||
* $Revision: 1.3 $
|
||||
* $Date: 2009-12-10 22:46:45 $
|
||||
* $Author: secretr $
|
||||
*
|
||||
*/
|
||||
@ -103,6 +103,32 @@ class plugin_featurebox_item extends e_model
|
||||
return $this->getParam('counter', 1);
|
||||
}
|
||||
|
||||
public function sc_featurebox_limit()
|
||||
{
|
||||
return $this->getParam('limit', 0);
|
||||
}
|
||||
|
||||
public function sc_featurebox_total()
|
||||
{
|
||||
return $this->getParam('total', 0);
|
||||
}
|
||||
|
||||
public function sc_featurebox_all()
|
||||
{
|
||||
return $this->getCategory()->sc_featurebox_category_all();
|
||||
}
|
||||
|
||||
public function sc_featurebox_cols()
|
||||
{
|
||||
return $this->getParam('cols', 1);
|
||||
}
|
||||
|
||||
|
||||
public function sc_featurebox_colcount()
|
||||
{
|
||||
return $this->getParam('col_counter', 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set current category
|
||||
* @param plugin_featurebox_category $category
|
||||
|
@ -9,8 +9,8 @@
|
||||
* Featurebox Category Tree model
|
||||
*
|
||||
* $Source: /cvs_backup/e107_0.8/e107_plugins/featurebox/includes/tree.php,v $
|
||||
* $Revision: 1.2 $
|
||||
* $Date: 2009-12-08 17:21:32 $
|
||||
* $Revision: 1.3 $
|
||||
* $Date: 2009-12-10 22:46:45 $
|
||||
* $Author: secretr $
|
||||
*
|
||||
*/
|
||||
@ -42,7 +42,7 @@ class plugin_featurebox_tree extends e_tree_model
|
||||
$this->updateParams($options);
|
||||
|
||||
$order = $this->getParam('random') ? ' ORDER BY rand()' : ' ORDER BY fb_order ASC';
|
||||
$limit = $this->getParam('limit') ? ' LIMIT 0,'.intval($this->getParam('limit')) : '';
|
||||
$limit = $this->getParam('limit') ? ' LIMIT '.intval($this->getParam('from'), 0).','.intval($this->getParam('limit')) : '';
|
||||
$qry = 'SELECT SQL_CALC_FOUND_ROWS * FROM #featurebox WHERE fb_category='.intval($category_id).' AND fb_class IN('.USERCLASS_LIST.')'.$order.$limit;
|
||||
$this->setParam('db_query', $qry);
|
||||
|
||||
|
@ -23,43 +23,62 @@ $FEATUREBOX_CATEGORY_TEMPLATE['default']['col_start'] = '';
|
||||
$FEATUREBOX_CATEGORY_TEMPLATE['default']['col_end'] = '';
|
||||
|
||||
$FEATUREBOX_CATEGORY_TEMPLATE['default']['item_start'] = '';
|
||||
|
||||
$FEATUREBOX_CATEGORY_TEMPLATE['default']['item_end'] = '';
|
||||
$FEATUREBOX_CATEGORY_TEMPLATE['default']['item_separator'] = '<div class="clear"><!-- --></div>';
|
||||
|
||||
// empty item - used with col templates, no shortcodes just basic markup
|
||||
$FEATUREBOX_CATEGORY_TEMPLATE['default']['item_empty'] = '';
|
||||
|
||||
$FEATUREBOX_CATEGORY_TEMPLATE['default']['item_separator'] = '<div class="clear"><!-- --></div>';
|
||||
// no dynamic load support
|
||||
$FEATUREBOX_CATEGORY_TEMPLATE['default']['nav_start'] = '';
|
||||
$FEATUREBOX_CATEGORY_TEMPLATE['default']['nav_item'] = '';
|
||||
$FEATUREBOX_CATEGORY_TEMPLATE['default']['nav_end'] = '';
|
||||
$FEATUREBOX_CATEGORY_TEMPLATE['default']['nav_separator'] = '';
|
||||
|
||||
// external JS, comma separated list
|
||||
$FEATUREBOX_CATEGORY_TEMPLATE['dynamic']['js'] = '';
|
||||
// inline JS, without <script> tags
|
||||
$FEATUREBOX_CATEGORY_TEMPLATE['dynamic']['js_inline'] = '';
|
||||
|
||||
/*
|
||||
* Dynamic Template
|
||||
* Example call: {FEATUREBOX|dynamic}
|
||||
*/
|
||||
$FEATUREBOX_CATEGORY_TEMPLATE['dynamic']['list_start'] = '
|
||||
<div class="box featurebox">
|
||||
<h2>{FEATUREBOX_CATEGORY_ICON}{FEATUREBOX_CATEGORY_TITLE}</h2>
|
||||
<div class="box featurebox" id="featurebox-container">
|
||||
<h2 class="title">{FEATUREBOX_CATEGORY_ICON}{FEATUREBOX_CATEGORY_TITLE}</h2>
|
||||
<div class="body">
|
||||
';
|
||||
|
||||
$FEATUREBOX_CATEGORY_TEMPLATE['dynamic']['list_end'] = '
|
||||
</div>
|
||||
<div class="clear"><!-- --></div>
|
||||
{FEATUREBOX_NAVIGATION|dynamic=loop}
|
||||
<div class="clear"><!-- --></div>
|
||||
</div>
|
||||
';
|
||||
|
||||
// no column support
|
||||
$FEATUREBOX_CATEGORY_TEMPLATE['default']['col_start'] = '';
|
||||
$FEATUREBOX_CATEGORY_TEMPLATE['default']['col_end'] = '';
|
||||
$FEATUREBOX_CATEGORY_TEMPLATE['dynamic']['col_start'] = '';
|
||||
$FEATUREBOX_CATEGORY_TEMPLATE['dynamic']['col_end'] = '';
|
||||
|
||||
// ajax navigation (unobtrusive)
|
||||
$FEATUREBOX_CATEGORY_TEMPLATE['dynamic']['item_start'] = '';
|
||||
|
||||
$FEATUREBOX_CATEGORY_TEMPLATE['dynamic']['item_end'] = '';
|
||||
|
||||
// empty item - used with col templates, no shortcodes just basic markup
|
||||
$FEATUREBOX_CATEGORY_TEMPLATE['default']['item_empty'] = '';
|
||||
|
||||
$FEATUREBOX_CATEGORY_TEMPLATE['dynamic']['item_separator'] = '<div class="clear"><!-- --></div>';
|
||||
|
||||
// empty item - used with col templates, no shortcodes just basic markup
|
||||
$FEATUREBOX_CATEGORY_TEMPLATE['dynamic']['item_empty'] = '';
|
||||
|
||||
$FEATUREBOX_CATEGORY_TEMPLATE['dynamic']['nav_start'] = '<div class="featurebox-nav show-if-js"> <a href="#" class="featurebox-nav-prev">prev</a> <a href="#" class="featurebox-nav-next">next</a> ';
|
||||
$FEATUREBOX_CATEGORY_TEMPLATE['dynamic']['nav_item'] = '<a href="#{FEATUREBOX_CATEGORY_TEMPLATE}.{FEATUREBOX_NAV_COUNTER}.{FEATUREBOX_CATEGORY_COLS}.{FEATUREBOX_CATEGORY_EMPTYFILL}" class="featurebox-nav-link{FEATUREBOX_NAV_ACTIVE}">{FEATUREBOX_NAV_COUNTER}</a>';
|
||||
$FEATUREBOX_CATEGORY_TEMPLATE['dynamic']['nav_end'] = '</div>';
|
||||
$FEATUREBOX_CATEGORY_TEMPLATE['dynamic']['nav_separator'] = ' ';
|
||||
|
||||
// external JS, comma separated list
|
||||
$FEATUREBOX_CATEGORY_TEMPLATE['dynamic']['js'] = '{e_PLUGIN}featurebox/featurebox.js';
|
||||
// inline JS, without <script> tags
|
||||
$FEATUREBOX_CATEGORY_TEMPLATE['dynamic']['js_inline'] = 'new Featurebox(\'featurebox-container\')';
|
||||
/**
|
||||
* Template information.
|
||||
* Allowed keys:
|
||||
|
@ -8,19 +8,21 @@ $FEATUREBOX_TEMPLATE['default'] = '
|
||||
</div>
|
||||
';
|
||||
|
||||
$sc_style['FEATUREBOX_IMAGE|image_left']['pre'] = '<div class="f-left">';
|
||||
$sc_style['FEATUREBOX_IMAGE|image_left']['post'] = '</div>';
|
||||
$FEATUREBOX_TEMPLATE['image_right'] = '
|
||||
<div class="featurebox-item imgleft" id="featurebox-item-{FEATUREBOX_ID}">
|
||||
<div class="featurebox-body">{FEATUREBOX_IMAGE|image_left}<h3>{FEATUREBOX_TITLE|image_left}</h3>{FEATUREBOX_TEXT|image_left}</div>
|
||||
$sc_style['FEATUREBOX_IMAGE|image_left']['pre'] = '<img class="f-left" src="';
|
||||
$sc_style['FEATUREBOX_IMAGE|image_left']['post'] = '" alt="" />';
|
||||
$FEATUREBOX_TEMPLATE['image_left'] = '
|
||||
<div class="featurebox-item">
|
||||
{FEATUREBOX_IMAGE|image_left=src}<h3>{FEATUREBOX_TITLE|image_left}</h3>{FEATUREBOX_TEXT|image_left}
|
||||
<div class="clear"><!-- --></div>
|
||||
</div>
|
||||
';
|
||||
|
||||
$sc_style['FEATUREBOX_IMAGE|image_right']['pre'] = '<div class="f-right">';
|
||||
$sc_style['FEATUREBOX_IMAGE|image_right']['post'] = '</div>';
|
||||
$sc_style['FEATUREBOX_IMAGE|image_right']['pre'] = '<img class="f-right" src="';
|
||||
$sc_style['FEATUREBOX_IMAGE|image_right']['post'] = '" alt="" />';
|
||||
$FEATUREBOX_TEMPLATE['image_right'] = '
|
||||
<div class="featurebox-item imgright" id="featurebox-item-{FEATUREBOX_ID}">
|
||||
<div class="featurebox-body">{FEATUREBOX_IMAGE|image_right}<h3>{FEATUREBOX_TITLE|image_right}</h3>{FEATUREBOX_TEXT|image_right}</div>
|
||||
<div class="featurebox-item">
|
||||
{FEATUREBOX_IMAGE|image_right=src}<h3>{FEATUREBOX_TITLE|image_right}</h3>{FEATUREBOX_TEXT|image_right}
|
||||
<div class="clear"><!-- --></div>
|
||||
</div>
|
||||
';
|
||||
|
||||
|
@ -97,8 +97,8 @@ pre {
|
||||
/******** Decorate JS */
|
||||
/* Admin List Table */
|
||||
.adminlist { width:100%; border:1px solid #ddd;}
|
||||
.adminlist th { padding: 5px; border-bottom:1px solid #ddd; border-right: 1px solid #ddd; font-weight: bold }
|
||||
.adminlist td { padding: 5px; border-bottom:1px solid #ddd; border-right: 1px solid #ddd; }
|
||||
.adminlist th { padding: 5px; border-bottom:1px solid #ddd; border-right: 1px solid #ddd; font-weight: bold; vertical-align: middle; }
|
||||
.adminlist td { padding: 5px; border-bottom:1px solid #ddd; border-right: 1px solid #ddd; vertical-align: middle; }
|
||||
.adminlist th.last,
|
||||
.adminlist td.last { border-right: 0px solid;}
|
||||
.adminlist tr.last td{ border-bottom: 0px solid;}
|
||||
|
@ -15,95 +15,58 @@ $register_sc[]='FS_ADMIN_ALT_NAV';
|
||||
$no_core_css = TRUE;
|
||||
|
||||
|
||||
if (!defined('ADMIN_TRUE_ICON'))
|
||||
{
|
||||
|
||||
define("ADMIN_TRUE_ICON", "<img class='icon action S32' src='".e_IMAGE_ABS."admin_images/true_32.png' alt='' />");
|
||||
define("ADMIN_TRUE_ICON_PATH", e_IMAGE."admin_images/true_32.png");
|
||||
}
|
||||
|
||||
if (!defined('ADMIN_FALSE_ICON'))
|
||||
{
|
||||
|
||||
|
||||
define("ADMIN_FALSE_ICON", "<img class='icon action S32' src='".e_IMAGE_ABS."admin_images/false_32.png' alt='' />");
|
||||
define("ADMIN_FALSE_ICON_PATH", e_IMAGE."admin_images/false_32.png");
|
||||
}
|
||||
|
||||
if (!defined('ADMIN_EDIT_ICON'))
|
||||
{
|
||||
|
||||
|
||||
define("ADMIN_EDIT_ICON", "<img class='icon action S32' src='".e_IMAGE_ABS."admin_images/edit_32.png' alt='' title='".LAN_EDIT."' />");
|
||||
define("ADMIN_EDIT_ICON_PATH", e_IMAGE."admin_images/edit_32.png");
|
||||
}
|
||||
|
||||
if (!defined('ADMIN_DELETE_ICON'))
|
||||
{
|
||||
|
||||
|
||||
define("ADMIN_DELETE_ICON", "<img class='icon action S32' src='".e_IMAGE_ABS."admin_images/delete_32.png' alt='' title='".LAN_DELETE."' />");
|
||||
define("ADMIN_DELETE_ICON_PATH", e_IMAGE."admin_images/delete_32.png");
|
||||
}
|
||||
|
||||
if (!defined('ADMIN_WARNING_ICON'))
|
||||
{
|
||||
|
||||
define("ADMIN_WARNING_ICON", "<img class='icon action S32' src='".e_IMAGE_ABS."admin_images/warning_32.png' alt='' />");
|
||||
define("ADMIN_WARNING_ICON_PATH", e_IMAGE."admin_images/warning_32.png");
|
||||
}
|
||||
|
||||
if (!defined('ADMIN_ADD_ICON'))
|
||||
{
|
||||
define("ADMIN_ADD_ICON", "<img class='icon action S32' src='".e_IMAGE_ABS."admin_images/add_32.png' alt='' />");
|
||||
define("ADMIN_ADD_ICON_PATH", e_IMAGE."admin_images/add_32.png");
|
||||
}
|
||||
|
||||
if (!defined('ADMIN_INFO_ICON'))
|
||||
{
|
||||
define("ADMIN_INFO_ICON", "<img class='icon action S32' src='".e_IMAGE_ABS."admin_images/info_32.png' alt='' />");
|
||||
define("ADMIN_INFO_ICON_PATH", e_IMAGE."admin_images/info_32.png");
|
||||
}
|
||||
|
||||
if (!defined('ADMIN_CONFIGURE_ICON'))
|
||||
{
|
||||
define("ADMIN_CONFIGURE_ICON", "<img class='icon action S32' src='".e_IMAGE_ABS."admin_images/configure_32.png' alt='' />");
|
||||
define("ADMIN_CONFIGURE_ICON_PATH", e_IMAGE."admin_images/configure_32.png");
|
||||
}
|
||||
|
||||
if (!defined('ADMIN_VIEW_ICON'))
|
||||
{
|
||||
define("ADMIN_VIEW_ICON", "<img class='icon action S32' src='".e_IMAGE_ABS."admin_images/search_32.png' alt='' />");
|
||||
define("ADMIN_VIEW_ICON_PATH", e_IMAGE."admin_images/admin_images/search_32.png");
|
||||
}
|
||||
|
||||
if (!defined('ADMIN_URL_ICON'))
|
||||
{
|
||||
define("ADMIN_URL_ICON", "<img class='icon action S32' src='".e_IMAGE_ABS."admin_images/forums_32.png' alt='' />");
|
||||
define("ADMIN_URL_ICON_PATH", e_IMAGE."admin_images/forums_32.png");
|
||||
}
|
||||
|
||||
if (!defined('ADMIN_INSTALLPLUGIN_ICON'))
|
||||
{
|
||||
define("ADMIN_INSTALLPLUGIN_ICON", "<img class='icon action S32' src='".e_IMAGE_ABS."admin_images/plugin_install_32.png' alt='' />");
|
||||
define("ADMIN_INSTALLPLUGIN_ICON_PATH", e_IMAGE."admin_images/plugin_install_32.png");
|
||||
}
|
||||
|
||||
if (!defined('ADMIN_UNINSTALLPLUGIN_ICON'))
|
||||
{
|
||||
define("ADMIN_UNINSTALLPLUGIN_ICON", "<img class='icon action S32' src='".e_IMAGE_ABS."admin_images/plugin_uninstall_32.png' alt='' />");
|
||||
define("ADMIN_UNINSTALLPLUGIN_ICON_PATH", e_IMAGE."admin_images/plugin_unstall_32.png");
|
||||
}
|
||||
|
||||
if (!defined('ADMIN_UPGRADEPLUGIN_ICON'))
|
||||
{
|
||||
define("ADMIN_UPGRADEPLUGIN_ICON", "<img class='icon action S32' src='".e_IMAGE_ABS."admin_images/up_32.png' alt='' />");
|
||||
define("ADMIN_UPGRADEPLUGIN_ICON_PATH", e_IMAGE."admin_images/up_32.png");
|
||||
}
|
||||
|
||||
if (!defined('ADMIN_UP_ICON'))
|
||||
{
|
||||
define("ADMIN_UP_ICON", "<img class='icon action S32' src='".e_IMAGE_ABS."admin_images/up_32.png' alt='' title='".LAN_DELETE."' />");
|
||||
define("ADMIN_UP_ICON_PATH", e_IMAGE."admin_images/up_32.png");
|
||||
}
|
||||
|
||||
if (!defined('ADMIN_DOWN_ICON'))
|
||||
{
|
||||
define("ADMIN_DOWN_ICON", "<img class='icon action S32' src='".e_IMAGE_ABS."admin_images/down_32.png' alt='' title='".LAN_DELETE."' />");
|
||||
define("ADMIN_DOWN_ICON_PATH", e_IMAGE."admin_images/down_32.png");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -190,3 +190,19 @@ legend { font-size: 14px; font-weight: bold; padding: 5px; }
|
||||
|
||||
/******** Horizontal navigation ADMIN_NAV_ALT */
|
||||
.navigation { border: 1px solid #DDDDDD;}
|
||||
|
||||
/******** FEATUREBOX PLUGIN */
|
||||
#featurebox-ajax-container { display: block }
|
||||
#featurebox-ajax-container img { padding: 1px; margin: 5px; border: 1px solid #DDDDDD }
|
||||
|
||||
div.featurebox-nav { text-align: right; margin-right: 5px }
|
||||
div.featurebox-nav a.featurebox-nav-link { }
|
||||
div.featurebox-nav a.featurebox-nav-link.active,
|
||||
div.featurebox-nav a.featurebox-nav-link.active:hover { text-decoration: none; color: #000 }
|
||||
|
||||
div.featurebox-nav a.featurebox-nav-next,
|
||||
div.featurebox-nav a.featurebox-nav-next:hover,
|
||||
div.featurebox-nav a.featurebox-nav-prev,
|
||||
div.featurebox-nav a.featurebox-nav-prev:hover { text-decoration: none; font-size: 16px }
|
||||
|
||||
|
||||
|
@ -7,58 +7,67 @@ $FEATUREBOX_CATEGORY_TEMPLATE = array();
|
||||
* Default Template
|
||||
* Example call: {FEATUREBOX} or {FEATUREBOX|default}
|
||||
*/
|
||||
$FEATUREBOX_CATEGORY_TEMPLATE['blank_default']['list_start'] = '
|
||||
$FEATUREBOX_CATEGORY_TEMPLATE['default']['list_start'] = '
|
||||
<div class="block">
|
||||
<h1 class="caption">{FEATUREBOX_CATEGORY_ICON} {FEATUREBOX_CATEGORY_TITLE}</h1>
|
||||
<div class="block-text">
|
||||
';
|
||||
|
||||
$FEATUREBOX_CATEGORY_TEMPLATE['blank_default']['list_end'] = '
|
||||
$FEATUREBOX_CATEGORY_TEMPLATE['default']['list_end'] = '
|
||||
</div>
|
||||
</div>
|
||||
';
|
||||
|
||||
// no column support
|
||||
$FEATUREBOX_CATEGORY_TEMPLATE['blank_default']['col_start'] = '';
|
||||
$FEATUREBOX_CATEGORY_TEMPLATE['blank_default']['col_end'] = '';
|
||||
$FEATUREBOX_CATEGORY_TEMPLATE['default']['col_start'] = '';
|
||||
$FEATUREBOX_CATEGORY_TEMPLATE['default']['col_end'] = '';
|
||||
|
||||
$FEATUREBOX_CATEGORY_TEMPLATE['blank_default']['item_start'] = '';
|
||||
|
||||
$FEATUREBOX_CATEGORY_TEMPLATE['blank_default']['item_end'] = '';
|
||||
$FEATUREBOX_CATEGORY_TEMPLATE['default']['item_start'] = '';
|
||||
$FEATUREBOX_CATEGORY_TEMPLATE['default']['item_end'] = '';
|
||||
|
||||
// empty item - used with col templates, no shortcodes just basic markup
|
||||
$FEATUREBOX_CATEGORY_TEMPLATE['blank_default']['item_empty'] = '';
|
||||
$FEATUREBOX_CATEGORY_TEMPLATE['default']['item_empty'] = '';
|
||||
|
||||
$FEATUREBOX_CATEGORY_TEMPLATE['blank_default']['item_separator'] = '<div class="clear"><!-- --></div>';
|
||||
$FEATUREBOX_CATEGORY_TEMPLATE['default']['item_separator'] = '<div class="clear"><!-- --></div>';
|
||||
|
||||
|
||||
/*
|
||||
* Dynamic Template
|
||||
* Example call: {FEATUREBOX|dynamic}
|
||||
*/
|
||||
$FEATUREBOX_CATEGORY_TEMPLATE['blank_dynamic']['list_start'] = '
|
||||
<div class="block">
|
||||
$FEATUREBOX_CATEGORY_TEMPLATE['dynamic']['list_start'] = '
|
||||
<div class="block" id="featurebox-container">
|
||||
<h1 class="caption">{FEATUREBOX_CATEGORY_ICON} {FEATUREBOX_CATEGORY_TITLE}</h1>
|
||||
<div class="block-text">
|
||||
{FEATUREBOX_NAVIGATION|dynamic=loop}
|
||||
<div class="block-text" id="featurebox-ajax-container">
|
||||
';
|
||||
|
||||
$FEATUREBOX_CATEGORY_TEMPLATE['blank_dynamic']['list_end'] = '
|
||||
$FEATUREBOX_CATEGORY_TEMPLATE['dynamic']['list_end'] = '
|
||||
</div>
|
||||
</div>
|
||||
';
|
||||
|
||||
// no column support
|
||||
$FEATUREBOX_CATEGORY_TEMPLATE['blank_dynamic']['col_start'] = '';
|
||||
$FEATUREBOX_CATEGORY_TEMPLATE['blank_dynamic']['col_end'] = '';
|
||||
$FEATUREBOX_CATEGORY_TEMPLATE['dynamic']['col_start'] = '';
|
||||
$FEATUREBOX_CATEGORY_TEMPLATE['dynamic']['col_end'] = '';
|
||||
|
||||
$FEATUREBOX_CATEGORY_TEMPLATE['blank_dynamic']['item_start'] = '';
|
||||
|
||||
$FEATUREBOX_CATEGORY_TEMPLATE['blank_dynamic']['item_end'] = '';
|
||||
// ajax navigation (unobtrusive)
|
||||
$FEATUREBOX_CATEGORY_TEMPLATE['dynamic']['item_start'] = '';
|
||||
$FEATUREBOX_CATEGORY_TEMPLATE['dynamic']['item_end'] = '';
|
||||
$FEATUREBOX_CATEGORY_TEMPLATE['dynamic']['item_separator'] = '<div class="clear"><!-- --></div>';
|
||||
|
||||
// empty item - used with col templates, no shortcodes just basic markup
|
||||
$FEATUREBOX_CATEGORY_TEMPLATE['blank_dynamic']['item_empty'] = '';
|
||||
$FEATUREBOX_CATEGORY_TEMPLATE['dynamic']['item_empty'] = '';
|
||||
|
||||
$FEATUREBOX_CATEGORY_TEMPLATE['blank_dynamic']['item_separator'] = '<div class="clear"><!-- --></div>';
|
||||
$FEATUREBOX_CATEGORY_TEMPLATE['dynamic']['nav_start'] = '<div class="featurebox-nav show-if-js"><a href="#" class="featurebox-nav-prev">«</a> ';
|
||||
$FEATUREBOX_CATEGORY_TEMPLATE['dynamic']['nav_item'] = '<a href="#{FEATUREBOX_CATEGORY_TEMPLATE}.{FEATUREBOX_NAV_COUNTER}.{FEATUREBOX_CATEGORY_COLS}.{FEATUREBOX_CATEGORY_EMPTYFILL}" class="featurebox-nav-link{FEATUREBOX_NAV_ACTIVE}">{FEATUREBOX_NAV_COUNTER}</a>';
|
||||
$FEATUREBOX_CATEGORY_TEMPLATE['dynamic']['nav_end'] = ' <a href="#" class="featurebox-nav-next">»</a></div>';
|
||||
$FEATUREBOX_CATEGORY_TEMPLATE['dynamic']['nav_separator'] = ' ';
|
||||
|
||||
// external JS, comma separated list
|
||||
$FEATUREBOX_CATEGORY_TEMPLATE['dynamic']['js'] = '{e_PLUGIN}featurebox/featurebox.js';
|
||||
// inline JS, without <script> tags
|
||||
$FEATUREBOX_CATEGORY_TEMPLATE['dynamic']['js_inline'] = 'new Featurebox("featurebox-container", { ajax_container: "featurebox-ajax-container", continuous: true })';
|
||||
|
||||
/**
|
||||
* Template information.
|
||||
@ -70,7 +79,7 @@ $FEATUREBOX_CATEGORY_TEMPLATE['blank_dynamic']['item_separator'] = '<div class="
|
||||
* @var array
|
||||
*/
|
||||
$FEATUREBOX_CATEGORY_TEMPLATE['__INFO__'] = array(
|
||||
'blank_default' => array('title' => 'Blank Theme Default - show by category limit'),
|
||||
'blank_dynamic' => array('title' => 'Blank Theme Dynamic (AJAX) loading'),
|
||||
'default' => array('title' => 'Blank Theme Default - show by category limit'),
|
||||
'dynamic' => array('title' => 'Blank Theme Dynamic (AJAX) loading'),
|
||||
);
|
||||
?>
|
@ -62,28 +62,45 @@ function theme_head() {
|
||||
|
||||
function tablestyle($caption, $text, $mod) {
|
||||
global $style;
|
||||
|
||||
$type = $style;
|
||||
if(empty($caption))
|
||||
{
|
||||
$type = 'box';
|
||||
}
|
||||
|
||||
switch($type)
|
||||
{
|
||||
|
||||
switch($style) {
|
||||
|
||||
case 'menu' :
|
||||
echo '
|
||||
<div class="block">
|
||||
<h4 class="caption">'.$caption.'</h4>
|
||||
'.$text.'
|
||||
</div>
|
||||
';
|
||||
break;
|
||||
|
||||
default:
|
||||
echo '
|
||||
<div class="block">
|
||||
<h1 class="caption">'.$caption.'</h1>
|
||||
<div class="block-text">
|
||||
case 'menu' :
|
||||
echo '
|
||||
<div class="block">
|
||||
<h4 class="caption">'.$caption.'</h4>
|
||||
'.$text.'
|
||||
</div>
|
||||
</div>
|
||||
';
|
||||
break;
|
||||
';
|
||||
break;
|
||||
|
||||
case 'box':
|
||||
echo '
|
||||
<div class="block">
|
||||
<div class="block-text">
|
||||
'.$text.'
|
||||
</div>
|
||||
</div>
|
||||
';
|
||||
break;
|
||||
|
||||
default:
|
||||
echo '
|
||||
<div class="block">
|
||||
<h1 class="caption">'.$caption.'</h1>
|
||||
<div class="block-text">
|
||||
'.$text.'
|
||||
</div>
|
||||
</div>
|
||||
';
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -112,7 +129,8 @@ $HEADER['default'] = '
|
||||
<div class="col-main">
|
||||
<div class="inner-wrapper">
|
||||
{SETSTYLE=content}
|
||||
{FEATUREBOX|blank_default=notablestyle}
|
||||
{FEATUREBOX|default=notablestyle}
|
||||
{FEATUREBOX|dynamic=notablestyle}
|
||||
';
|
||||
$FOOTER['default'] = '
|
||||
</div>
|
||||
|
@ -9,8 +9,8 @@
|
||||
*
|
||||
*
|
||||
* $Source: /cvs_backup/e107_0.8/e107_themes/jayya/theme.php,v $
|
||||
* $Revision: 1.12 $
|
||||
* $Date: 2009-12-08 17:21:35 $
|
||||
* $Revision: 1.13 $
|
||||
* $Date: 2009-12-10 22:46:46 $
|
||||
* $Author: secretr $
|
||||
*/
|
||||
|
||||
@ -74,6 +74,7 @@ $HEADER['3_column'] = "<table class='page_container'>
|
||||
<td class='default_menu'>
|
||||
{SETSTYLE=default}
|
||||
{FEATUREBOX|default}
|
||||
{FEATUREBOX|dynamic}
|
||||
{WMESSAGE}
|
||||
";
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user