Page MenuHomeIn-Portal Phabricator

in-portal
No OneTemporary

File Metadata

Created
Tue, Feb 25, 1:27 PM

in-portal

Index: branches/RC/themes/default2009/platform/template_manager/html_head.tpl
===================================================================
--- branches/RC/themes/default2009/platform/template_manager/html_head.tpl (revision 11639)
+++ branches/RC/themes/default2009/platform/template_manager/html_head.tpl (revision 11640)
@@ -1,160 +1,160 @@
<link rel="stylesheet" href="<inp2:m_TemplatesBase module='In-Portal'/>template_manager/inc/template_manager.css" type="text/css" media="screen" />
<!--<script type="text/javascript" src="<inp2:m_TemplatesBase module='In-Portal'/>inc/jquery/jquery-ui-personalized-1.5.2.js"></script>-->
<script type="text/javascript" src="<inp2:m_TemplatesBase module='In-Portal'/>inc/jquery/interface/iutil.js"></script>
<script type="text/javascript" src="<inp2:m_TemplatesBase module='In-Portal'/>inc/jquery/interface/idrag.js"></script>
<script type="text/javascript" src="<inp2:m_TemplatesBase module='In-Portal'/>inc/jquery/interface/idrop.js"></script>
<script type="text/javascript" src="<inp2:m_TemplatesBase module='In-Portal'/>inc/jquery/interface/isortables.js"></script>
<script type="text/javascript" src="<inp2:m_TemplatesBase module='In-Portal'/>inc/jquery/interface/iautoscroller.js"></script>
<script type="text/javascript" src="<inp2:m_TemplatesBase module='In-Portal'/>template_manager/inc/template_manager.js"></script>
<script type="text/javascript" src="<inp2:m_TemplatesBase module='In-Portal'/>template_manager/inc/codepress/codepress.js" ></script>
<style type="text/css" media="all">
.groupWrapper {
/*width: 32%;
float: left;
margin-right: 1%;*/
/*border: 1px solid green;*/
min-height: 200px;
}
/*.serializer {
clear: both;
}*/
/*.groupItem {
margin-bottom: 20px;
}*/
<inp2:m_if check="m_GetConst" name="EDITING_MODE" equals_to="2">
.groupItem .itemHeader {
cursor: move;
/*line-height: 28px;
background-color: #DAFF9F;
border-top: 2px solid #B5EF59;
color: #000;
padding: 0 10px;
font-weight: bold;
font-size: 16px;
height: 28px;
position: relative;*/
}
</inp2:m_if>
/*.groupItem .itemHeader a {
position: absolute;
right: 10px;
top: 0px;
font-weight: normal;
font-size: 11px;
text-decoration: none;
}*/
.sortHelper {
border: 3px dashed #666;
width: auto !important;
}
/*.groupWrapper p {
height: 1px;
overflow: hidden;
margin: 0;
padding: 0;
}*/
</style>
<inp2:m_if check="m_GetConst" name="EDITING_MODE">
<div class="extra-toolbar" style="display: none;">
<inp2:m_DefineElement name="edit_mode_element" template="" is_last="0">
<inp2:m_if check="m_GetConst" name="EDITING_MODE" equals_to="$editing_mode">
<td class="button-active" style="padding-right: 5px;">
</td>
<td class="button-active">
<img src="img/top_frame/icons/<inp2:m_Param name='image'/>.gif" alt="" border="0"/>&nbsp;
</td>
<td class="button-active" style="padding-right: 5px;<inp2:m_ifnot check='m_Param' name='is_last'> border-right: 1px solid #BBBBBB;</inp2:m_ifnot>">
<strong><inp2:m_Param name="title"/></strong>
</td>
<inp2:m_else/>
<td style="padding-right: 5px; height: 22px;">
</td>
<td>
- <a class="kx-header-link" href="<inp2:m_Link template='$template'/>" onclick="getFrame('main').location.href = this.href; return false;">
+ <a class="kx-header-link" href="<inp2:m_Link template='$template' pass='all'/>" onclick="getFrame('main').location.href = this.href; return false;">
<img src="img/top_frame/icons/<inp2:m_Param name='image'/>.gif" alt="" border="0"/>
</a>&nbsp;
</td>
<td style="padding-right: 5px;<inp2:m_ifnot check='m_Param' name='is_last'> border-right: 1px solid #BBBBBB;</inp2:m_ifnot>">
- <a class="kx-header-link" href="<inp2:m_Link editing_mode='$editing_mode'/>" onclick="getFrame('main').location.href = this.href; return false;"><inp2:m_Param name="title"/></a>
+ <a class="kx-header-link" href="<inp2:m_Link editing_mode='$editing_mode' pass='all'/>" onclick="getFrame('main').location.href = this.href; return false;"><inp2:m_Param name="title"/></a>
</td>
</inp2:m_if>
</inp2:m_DefineElement>
<table cellpadding="0" cellspacing="0">
<tr>
<inp2:m_RenderElement name="edit_mode_element" editing_mode="1" image="show_structure" title="Browse Mode" no_editing="1" strip_nl="2"/>
<inp2:m_RenderElement name="edit_mode_element" editing_mode="4" image="content_mode" title="Content Mode" no_editing="1" strip_nl="2"/>
<inp2:m_RenderElement name="edit_mode_element" editing_mode="2" image="show_all" title="Layout Mode" no_editing="1" strip_nl="2"/>
<inp2:m_RenderElement name="edit_mode_element" editing_mode="3" image="show_all" title="Design Mode" no_editing="1" strip_nl="2" is_last="1"/>
</tr>
</table>
</div>
</inp2:m_if>
<script type="text/javascript">
TB.pathToImage = '<inp2:m_TemplatesBase module="In-Portal"/>inc/jquery/thickbox/loadingAnimation.gif';
<inp2:m_Get name="t" result_to_var="template"/>
- var aTemplateManager = new TemplateManager('<inp2:m_Link template="platform/template_manager/edit_template" width="800" height="550" events[st]="#EVENT#" block="#BLOCK#" source="$template" no_amp="1"/>');
+ var aTemplateManager = new TemplateManager('<inp2:m_Link template="platform/template_manager/edit_template" width="800" height="550" events[st]="#EVENT#" block="#BLOCK#" source="$template" pass="all" no_amp="1"/>');
$(
function () {
<inp2:m_if check="m_GetConst" name="EDITING_MODE">
getFrame('head').$('#extra_toolbar').html( $('div.extra-toolbar').html() );
</inp2:m_if>
<inp2:m_if check="m_GetConst" name="EDITING_MODE" equals_to="2">
$('div.groupWrapper').Sortable(
{
accept: 'groupItem',
helperclass: 'sortHelper',
activeclass : 'sortableactive',
hoverclass : 'sortablehover',
handle: 'td.itemHeader',
tolerance: 'pointer',
onChange : function(ser)
{
},
onStart : function()
{
$.iAutoscroller.start(this, document.getElementsByTagName('body'));
},
onStop : function()
{
$.iAutoscroller.stop();
}
}
);
/*$('div.groupWrapper').sortable(
{
placeholder: 'sortHelper',
handle: 'td.itemHeader',
appendTo: 'body',
connectWith: ['div.groupWrapper'],
revert: true,
start: function(e, ui) {
ui.helper.css('width', ui.item.width());
}
}
);*/
</inp2:m_if>
}
);
</script>
\ No newline at end of file
Property changes on: branches/RC/themes/default2009/platform/template_manager/html_head.tpl
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.1.2.1
\ No newline at end of property
+1.1.2.2
\ No newline at end of property
Index: branches/RC/core/units/general/helpers/category_helper.php
===================================================================
--- branches/RC/core/units/general/helpers/category_helper.php (revision 11639)
+++ branches/RC/core/units/general/helpers/category_helper.php (revision 11640)
@@ -1,253 +1,254 @@
<?php
class CategoryHelper extends kHelper {
function NavigationBar($params)
{
$main_category_id = isset($params['cat_id']) ? $params['cat_id'] : $this->Application->GetVar('m_cat_id');
$home_element = $this->getHomeCategoryPath($params, $main_category_id);
if (!getArrayValue($params, 'titles') && !getArrayValue($params, 'templates')) {
// no static templates given, show only category path
return $home_element . $this->getCategoryPath($main_category_id, $params);
}
$navigation_parts = $this->getNavigationParts($params['titles'], $params['templates']);
$ret = '';
$block_params = Array (); //$params; // sort of TagProcessor:prepareTagParams
$block_params['no_editing'] = 1;
$block_params['category'] = 0;
$block_params['separator'] = $params['separator'];
$current_template = $this->Application->GetVar('t');
$show_category = getArrayValue($params, 'show_category');
foreach ($navigation_parts as $template => $title) {
$block_params['template'] = $template;
if ($title == '__item__') {
if ($show_category) {
$ret .= $this->getCategoryPath($main_category_id, $params);
$show_category = false;
}
$category_path = $this->getCategoryParentPath($main_category_id);
$module_info = $this->getCategoryModule($params, array_keys($category_path));
if (!$module_info) {
continue;
}
$module_prefix = $module_info['Var'];
$object =& $this->Application->recallObject($module_prefix);
/* @var $object kCatDBItem */
$title_field = $this->Application->getUnitOption($module_prefix, 'TitleField');
$block_params['title'] = $object->GetField($title_field);
$block_params['prefix'] = $module_prefix;
$block_params['current'] = 0;
$block_params['name'] = $this->SelectParam($params, 'module_item_render_as,render_as');
}
else {
$block_params['current'] = ($template == $current_template);
$block_params['title'] = $this->Application->Phrase($title);
$block_params['name'] = $template == $current_template ? $params['current_render_as'] : $params['render_as'];
}
$ret .= $this->Application->ParseBlock($block_params);
}
if ($show_category) {
$params['no_current'] = true;
return $home_element . ($show_category ? $this->getCategoryPath($main_category_id, $params) : '') . $ret;
}
return $home_element . $ret;
}
/**
* Get navigation parts
*
* @param Array $titles
* @param Array $templates
* @return Array
*/
function getNavigationParts($titles, $templates)
{
$titles = explode(',', $titles);
$templates = explode(',', $templates);
$ret = Array ();
foreach ($templates as $template_pos => $template) {
$ret[$template] = $titles[$template_pos];
}
return $ret;
}
function getCategoryPath($main_category_id, $params)
{
$category_path = $this->getCategoryParentPath($main_category_id);
if (!$category_path) {
// in "Home" category
return '';
}
$module_info = $this->getCategoryModule($params, array_keys($category_path));
$module_category_id = $module_info['RootCat'];
$module_item_id = $this->Application->GetVar($module_info['Var'].'_id');
$ret = '';
$block_params['category'] = 1;
+ $block_params['no_editing'] = 1;
$block_params['separator'] = $params['separator'];
$no_current = isset($params['no_current']) && $params['no_current'];
$backup_category_id = $this->Application->GetVar('c_id');
foreach ($category_path as $category_id => $category_name) {
$block_params['cat_id'] = $category_id;
$block_params['cat_name'] = $block_params['title'] = $category_name;
if ($no_current) {
$block_params['current'] = 0;
}
else {
$block_params['current'] = ($main_category_id == $category_id) && !$module_item_id ? 1 : 0;
}
$block_params['is_module_root'] = $category_id == $module_category_id ? 1 : 0;
$block_params['name'] = $this->SelectParam($params, 'render_as,block');
// which block to parse as current ?
if ($block_params['is_module_root']) {
$block_params['name'] = $this->SelectParam($params, 'module_root_render_as,render_as');
$block_params['module_index'] = $module_info['TemplatePath'].'index';
}
if ($block_params['current']) {
$block_params['name'] = $this->SelectParam($params, 'current_render_as,render_as');
}
$this->Application->SetVar('c_id', $category_id);
$ret .= $this->Application->ParseBlock($block_params);
}
$this->Application->SetVar('c_id', $backup_category_id);
return $ret;
}
/**
* Returns module information based on given module name or current category (relative to module root categories)
*
* @param Array $params
* @param Array $category_ids category parent path (already as array)
* @return Array
*/
function getCategoryModule($params, $category_ids)
{
if (isset($params['module'])) {
// get module by name specified
$module_info = $this->Application->findModule('Name', $params['module']);
}
elseif ($category_ids) {
// get module by category path
$module_root_categories = $this->getModuleRootCategories();
$module_category_id = array_shift(array_intersect($category_ids, $module_root_categories));
$module_info = $this->Application->findModule('RootCat', $module_category_id);
}
return $module_info;
}
function getHomeCategoryPath($params, $current_category)
{
$block_params['cat_id'] = $this->Application->findModule('Name', 'Core', 'RootCat'); // 0;
$block_params['no_editing'] = 1;
$block_params['current'] = $current_category == $block_params['cat_id'] ? 1 : 0;
$block_params['separator'] = $params['separator'];
$block_params['cat_name'] = $this->Application->ProcessParsedTag('m', 'RootCategoryName', $params);
$block_params['name'] = $this->SelectParam($params, 'root_cat_render_as,render_as');
return $this->Application->ParseBlock($block_params);
}
function getModuleRootCategories()
{
static $root_categories = null;
if (!isset($root_categories)) {
$root_categories = Array ();
foreach ($this->Application->ModuleInfo as $module_name => $module_info) {
array_push($root_categories, $module_info['RootCat']);
}
$root_categories = array_unique($root_categories);
}
return $root_categories;
}
function getCategoryParentPath($main_category_id)
{
static $cached_path = null;
if ($main_category_id == 0) {
// don't query path for "Home" category
return Array ();
}
if (!isset($cached_path[$main_category_id])) {
$ml_formatter =& $this->Application->recallObject('kMultiLanguage');
$navbar_field = $ml_formatter->LangFieldName('CachedNavBar');
$id_field = $this->Application->getUnitOption('c', 'IDField');
$table_name = $this->Application->getUnitOption('c', 'TableName');
$sql = 'SELECT '.$navbar_field.', ParentPath
FROM '.$table_name.'
WHERE '.$id_field.' = '.$main_category_id;
$category_data = $this->Conn->GetRow($sql);
$skip_category = $this->Application->findModule('Name', 'Core', 'RootCat');
$cached_path[$main_category_id] = Array ();
if ($category_data) {
$category_names = explode('&|&', $category_data[$navbar_field]);
$category_ids = explode('|', substr($category_data['ParentPath'], 1, -1));
foreach ($category_ids as $category_index => $category_id) {
if ($category_id == $skip_category) {
continue;
}
$cached_path[$main_category_id][$category_id] = $category_names[$category_index];
}
}
}
return $cached_path[$main_category_id];
}
/**
* Not tag, method for parameter
* selection from list in this TagProcessor
*
* @param Array $params
* @param string $possible_names
* @return string
* @access public
*/
function SelectParam($params, $possible_names)
{
if (!is_array($params)) return;
if (!is_array($possible_names))
$possible_names = explode(',', $possible_names);
foreach ($possible_names as $name)
{
if( isset($params[$name]) ) return $params[$name];
}
return false;
}
}
?>
\ No newline at end of file
Property changes on: branches/RC/core/units/general/helpers/category_helper.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.3.2.5
\ No newline at end of property
+1.3.2.6
\ No newline at end of property

Event Timeline