Harald Ponce de Leon, on 03 March 2012 - 11:27 AM, said:
The {value} Template Tag has been updated to retrieve the value in the following order:
- Load the value module at the Application level (if module exists), else
- Load the value module at the Site level (if module exists), else
- Load the value internally if no module exists
.../...
change this class with :
file : \osCommerce\OM\Core\Template\Tag\value.php
<?php
/**
* osCommerce Online Merchant
*
* @[member='copyright'] Copyright (c) 2012 osCommerce; http://www.oscommerce.com
* @[member='copyright'] Copyright (c) 2012 FoxP2;
* @[member='licensed2kill'] BSD License; http://www.oscommerce.com/bsdlicense.txt
*/
namespace osCommerce\OM\Core\Template\Tag;
use osCommerce\OM\Core\OSCOM;
use osCommerce\OM\Core\Registry;
class value extends \osCommerce\OM\Core\Template\TagAbstract {
static protected $_parse_result = false;
static public function execute($string) {
$OSCOM_Template = Registry::get('Template');
if ( !$OSCOM_Template->valueExists($string) ) {
// foxp2 : override {value] tag or call {value} tag in custom directory
if ( class_exists('osCommerce\\OM\\Custom\\Site\\' . OSCOM::getSite() . '\\Module\\Template\\Value\\' . $string . '\\Controller') && is_subclass_of('osCommerce\\OM\\Custom\\Site\\' . OSCOM::getSite() . '\\Module\\Template\\Value\\' . $string . '\\Controller', 'osCommerce\\OM\\Core\\Template\\ValueAbstract') ){
call_user_func(array('osCommerce\\OM\\Custom\\Site\\' . OSCOM::getSite() . '\\Module\\Template\\Value\\' . $string . '\\Controller', 'initialize'));
} elseif ( class_exists('osCommerce\\OM\\Core\\Site\\' . OSCOM::getSite() . '\\Application\\' . OSCOM::getSiteApplication() . '\\Module\\Template\\Value\\' . $string . '\\Controller') && is_subclass_of('osCommerce\\OM\\Core\\Site\\' . OSCOM::getSite() . '\\Application\\' . OSCOM::getSiteApplication() . '\\Module\\Template\\Value\\' . $string . '\\Controller', 'osCommerce\\OM\\Core\\Template\\ValueAbstract') ) {
call_user_func(array('osCommerce\\OM\\Core\\Site\\' . OSCOM::getSite() . '\\Application\\' . OSCOM::getSiteApplication() . '\\Module\\Template\\Value\\' . $string . '\\Controller', 'initialize'));
} elseif ( class_exists('osCommerce\\OM\\Core\\Site\\' . OSCOM::getSite() . '\\Module\\Template\\Value\\' . $string . '\\Controller') && is_subclass_of('osCommerce\\OM\\Core\\Site\\' . OSCOM::getSite() . '\\Module\\Template\\Value\\' . $string . '\\Controller', 'osCommerce\\OM\\Core\\Template\\ValueAbstract') ) {
call_user_func(array('osCommerce\\OM\\Core\\Site\\' . OSCOM::getSite() . '\\Module\\Template\\Value\\' . $string . '\\Controller', 'initialize'));
}
}
return $OSCOM_Template->getValue($string);
}
}
?>
ok, now i can create my own nav apps menu like :
\osCommerce\OM\Custom\Site\Admin\Module\Template\Value\apps_links_responsive\Controller.php :
<?php
/**
* osCommerce Online Merchant
*
* @[member='copyright'] Copyright (c) 2012 osCommerce; http://www.oscommerce.com
* @[member='copyright'] Copyright (c) 2012 FoxP2
* @[member='licensed2kill'] BSD License; http://www.oscommerce.com/bsdlicense.txt
*/
namespace osCommerce\OM\Core\Site\Admin\Module\Template\Value\apps_links_responsive;
use osCommerce\OM\Core\Access;
use osCommerce\OM\Core\OSCOM;
use osCommerce\OM\Core\Registry;
class Controller extends \osCommerce\OM\Core\Template\ValueAbstract {
static public function execute() {
$OSCOM_Template = Registry::get('Template');
$apps_links_responsive = '';
if ( isset($_SESSION[OSCOM::getSite()]['id']) ) {
$apps_links_responsive .= '<div class="subnavbar">';
$apps_links_responsive .= ' <div class="subnavbar-inner">';
$apps_links_responsive .= ' <div class="container">';
$apps_links_responsive .= ' <ul class="mainnav">';
// dashboard link
$apps_links_responsive .= ' <li>';
$apps_links_responsive .= ' <a href=' . OSCOM::getLink(null, OSCOM::getDefaultSiteApplication()) . '><i class="icon-dashboard"></i><span>Dashboard</span></a>';
$apps_links_responsive .= ' </li>';
// apps menu
foreach ( Access::getLevels() as $group => $links ) {
$application = current($links);
$apps_links_responsive .= ' <li class="dropdown">';
$apps_links_responsive .= ' <a href="#" class="dropdown-toggle" data-toggle="dropdown">';
$apps_links_responsive .= ' <i class=' . Access::getGroupIcon($group) . '></i>';
$apps_links_responsive .= ' <span>' . Access::getGroupTitle($group) . '</span>';
$apps_links_responsive .= ' <b class="caret"></b>';
$apps_links_responsive .= ' </a>';
$apps_links_responsive .= ' <ul class="dropdown-menu">';
foreach ( $links as $link ) {
$apps_links_responsive .= ' <li><a href=' . OSCOM::getLink(null, $link['module']) . '>' . $link['title'] . '</a></li>';
}
$apps_links_responsive .= ' </ul>';
$apps_links_responsive .= ' </li>';
}
$apps_links_responsive .= ' </ul>';
$apps_links_responsive .= ' </div>';
$apps_links_responsive .= ' </div>';
$apps_links_responsive .= '</div>';
}
return $apps_links_responsive;
}
}
?>
and called it my header.html :
{iftrue logged_in}
{value}apps_links_responsive{value}
{iftrue}
for an efficient navigation :
[attachment=1466:AppsNav.PNG]
yes, i use Boostrap Twitter to build template (like, for example, joomla 3 : http://community.joomla.org/blogs/community/1671-joomla-30-alpha-2-notes.html )









