Page MenuHomeIn-Portal Phabricator

in-portal
No OneTemporary

File Metadata

Created
Tue, Jun 24, 11:30 PM

in-portal

Index: branches/unlabeled/unlabeled-1.27.2/kernel/admin_templates/catalog.tpl
===================================================================
--- branches/unlabeled/unlabeled-1.27.2/kernel/admin_templates/catalog.tpl (nonexistent)
+++ branches/unlabeled/unlabeled-1.27.2/kernel/admin_templates/catalog.tpl (revision 6792)
@@ -0,0 +1,234 @@
+<inp2:m_RequireLogin permissions="in-portal:browse.view" system="1" ajax="yes"/>
+<inp2:m_include t="incs/header" nobody="yes" noform="yes"/>
+
+<body topmargin="0" leftmargin="8" marginheight="0" marginwidth="8" bgcolor="#FFFFFF" onload="$Catalog.Init();">
+<inp2:m_ParseBlock name="section_header" prefix="c" icon="icon46_catalog" module="in-portal" title="!la_title_Browse!"/>
+
+<inp2:m_ParseBlock name="blue_bar" prefix="c" title_preset="catalog" module="in-portal"/>
+
+<!-- main kernel_form: begin -->
+<inp2:m_RenderElement name="kernel_form"/>
+<!-- ToolBar --->
+<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%" border="0">
+<tbody>
+ <tr>
+ <td>
+ <input type="hidden" name="m_cat_id" value="<inp2:m_get name="m_cat_id"/>"/>
+ <script type="text/javascript" src="<inp2:m_TemplatesBase module="in-portal"/>/incs/fw_menu.js"></script>
+ <script type="text/javascript" src="js/ajax.js"></script>
+ <script type="text/javascript" src="<inp2:m_TemplatesBase module="in-portal"/>/incs/catalog.js"></script>
+ <script type="text/javascript">
+ Request.progressText = '<inp2:m_phrase name="la_title_Loading" escape="1"/>';
+ var $is_catalog = true;
+ var $Catalog = new Catalog('<inp2:m_Link template="#TEMPLATE_NAME#" m_cat_id="#CATEGORY_ID#" no_amp="1"/>', 'catalog_');
+ var a_toolbar = new ToolBar();
+
+ a_toolbar.AddButton( new ToolBarButton('in-portal:upcat', '<inp2:m_phrase label="la_ToolTip_Up" escape="1"/>', function() {
+ $Catalog.go_to_cat($Catalog.ParentCategoryID);
+ }
+ ) );
+
+ a_toolbar.AddButton( new ToolBarButton('in-portal:homecat', '<inp2:m_phrase label="la_ToolTip_Home" escape="1"/>', function() {
+ $Catalog.go_to_cat(0);
+ }
+ ) );
+
+ a_toolbar.AddButton( new ToolBarSeparator('sep1') );
+
+ a_toolbar.AddButton( new ToolBarButton('in-portal:new_cat', '<inp2:m_phrase label="la_ToolTip_New_Category" escape="1"/>', function() {
+ std_precreate_item('c', 'in-portal/categories/categories_edit');
+ }
+ ) );
+
+
+ a_toolbar.AddButton( new ToolBarButton('in-portal:editcat', '<inp2:m_phrase label="la_ToolTip_Edit_Current_Category" escape="1"/>', function() {
+ var $edit_url = '<inp2:m_t t="#TEMPLATE#" m_opener="d" c_mode="t" c_event="OnEdit" c_id="#CATEGORY_ID#" pass="all,c" no_amp="1"/>';
+ var $category_id = get_hidden_field('m_cat_id');
+ var $redirect_url = $edit_url.replace('#CATEGORY_ID#', $category_id);
+ $redirect_url = $redirect_url.replace('#TEMPLATE#', $category_id > 0 ? 'in-portal/categories/categories_edit' : 'in-portal/categories/categories_edit_permissions');
+ redirect($redirect_url);
+ }
+ ) );
+
+ <inp2:m_ModuleInclude template="catalog_tab" tab_init="1" skip_prefixes="m"/>
+
+
+ a_toolbar.AddButton( new ToolBarButton('edit', '<inp2:m_phrase label="la_ToolTip_Edit" escape="1"/>', edit) );
+
+ a_toolbar.AddButton( new ToolBarButton('delete', '<inp2:m_phrase label="la_ToolTip_Delete" escape="1"/>',
+ function() {
+ var $template = $Catalog.queryTabRegistry('prefix', $Catalog.getCurrentPrefix(), 'view_template');
+ std_delete_items($Catalog.getCurrentPrefix(), $template, 1);
+ } ) );
+
+
+ a_toolbar.AddButton( new ToolBarSeparator('sep2') );
+
+ a_toolbar.AddButton( new ToolBarButton('approve', '<inp2:m_phrase label="la_ToolTip_Approve" escape="1"/>', function() {
+ $Catalog.submit_event(null, 'OnMassApprove');
+ }
+ ) );
+
+ a_toolbar.AddButton( new ToolBarButton('decline', '<inp2:m_phrase label="la_ToolTip_Decline" escape="1"/>', function() {
+ $Catalog.submit_event(null, 'OnMassDecline');
+ }
+ ) );
+
+ a_toolbar.AddButton( new ToolBarSeparator('sep3') );
+
+ a_toolbar.AddButton( new ToolBarButton('in-portal:export', '<inp2:m_phrase label="la_ToolTip_Export" escape="1"/>', function() {
+ var $export_prefixes = new Array('l', 'p');
+ if (in_array($Catalog.ActivePrefix, $export_prefixes)) {
+ submit_event($Catalog.ActivePrefix, 'OnExport');
+ }
+ else {
+ alert('<inp2:m_phrase name="la_Text_InDevelopment" escape="1"/>');
+ }
+ }
+ ) );
+
+ a_toolbar.AddButton( new ToolBarButton('in-portal:rebuild_cache', '<inp2:m_phrase label="la_ToolTip_RebuildCategoryCache" escape="1"/>', function() {
+ redirect('<inp2:m_t t="in-portal/categories/cache_updater" pass="m"/>');
+ }
+ ) );
+
+ a_toolbar.AddButton( new ToolBarSeparator('sep4') );
+
+
+ a_toolbar.AddButton( new ToolBarButton('in-portal:cut', '<inp2:m_phrase label="la_ToolTip_Cut" escape="1"/>', function() {
+ $Catalog.submit_event(null, 'OnCut');
+ }
+ ) );
+
+ a_toolbar.AddButton( new ToolBarButton('in-portal:copy', '<inp2:m_phrase label="la_ToolTip_Copy" escape="1"/>', function() {
+ $Catalog.submit_event(null, 'OnCopy');
+ }
+ ) );
+
+
+ a_toolbar.AddButton( new ToolBarButton('in-portal:paste', '<inp2:m_phrase label="la_ToolTip_Paste" escape="1"/>', function() {
+ $Catalog.submit_event('c', 'OnPasteClipboard', null, function($object) {
+ $object.resetTabs(true);
+ $object.switchTab();
+ } );
+ }
+ ) );
+
+ /*a_toolbar.AddButton( new ToolBarButton('clear_clipboard', '<inp2:m_phrase label="la_ToolTip_ClearClipboard" escape="1"/>', function() {
+ if (confirm('<inp2:m_phrase name="la_text_ClearClipboardWarning" js_escape="1"/>')) {
+ $Catalog.submit_event('c', 'OnClearClipboard', null, function($object) {
+ $GridManager.CheckDependencies($object.ActivePrefix);
+ } );
+ }
+ }
+ ) );*/
+
+ a_toolbar.AddButton( new ToolBarSeparator('sep5') );
+
+ a_toolbar.AddButton( new ToolBarButton('move_up', '<inp2:m_phrase label="la_ToolTip_Move_Up" escape="1"/>', function() {
+ $Catalog.submit_event(null, 'OnMassMoveUp');
+ }
+ ) );
+
+
+ a_toolbar.AddButton( new ToolBarButton('move_down', '<inp2:m_phrase label="la_ToolTip_Move_Down" escape="1"/>', function() {
+ $Catalog.submit_event(null, 'OnMassMoveDown');
+ }
+ ) );
+
+ a_toolbar.AddButton( new ToolBarSeparator('sep6') );
+
+ a_toolbar.AddButton( new ToolBarButton('view', '<inp2:m_phrase label="la_ToolTip_View" escape="1"/>', function() {
+ show_viewmenu(a_toolbar, 'view');
+ }
+ ) );
+
+ a_toolbar.Render();
+
+ function edit()
+ {
+ var $current_prefix = $Catalog.getCurrentPrefix();
+ $form_name = $Catalog.queryTabRegistry('prefix', $current_prefix, 'tab_id') + '_form';
+ std_edit_item($current_prefix, $Catalog.queryTabRegistry('prefix', $current_prefix, 'edit_template'));
+ }
+ </script>
+ </td>
+ </tr>
+</tbody>
+</table>
+<inp2:m_RenderElement name="kernel_form_end"/>
+<!-- main kernel_form: end -->
+
+<!-- category list: begin -->
+<table id="c_search_warning" width="100%" border="0" cellspacing="0" cellpadding="4" class="table_border_notop" style="display: none">
+ <tr>
+ <td valign="top" class="hint_red">
+ <inp2:m_phrase name="la_Warning_Filter"/>
+ </td>
+ </tr>
+</table>
+
+<inp2:m_set t="in-portal/xml/categories_list"/>
+<inp2:m_RenderElement name="kernel_form" form_name="categories_form"/>
+<table class="toolbar" cellspacing="0" cellpadding="2" width="100%" border="0" class="tableborder_full_a">
+ <tr bgcolor="#e0e0da" height="20">
+ <td width="100%" valign="middle">
+ <img height="15" src="img/arrow.gif" width="15" align="absmiddle" border="0"><span id="category_path"></span>
+ </td>
+ <td align="right">
+ <table cellspacing="0" cellpadding="0" border="0">
+ <tr>
+ <td>Search:&nbsp;</td>
+ <td>
+ <input type="text" id="c_search_keyword" name="c_search_keyword" value="" PrefixSpecial="c" Grid="Default" ajax="1" style="border: 1px solid grey;">
+ <input type="text" style="display: none"; />
+ </td>
+ <td id="search_buttons[c]">
+ <script type="text/javascript">
+ <inp2:m_RenderElement name="grid_search_buttons" PrefixSpecial="c" grid="Default" ajax="1"/>
+ </script>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+</table>
+
+<div id="categories_div" prefix="c" view_template="in-portal/xml/categories_list" edit_template="in-portal/categories/categories_edit" dep_buttons="" class="catalog-tab" style="display: block;"></div>
+<inp2:m_RenderElement name="kernel_form_end"/>
+<inp2:m_set t="in-portal/catalog"/>
+<script type="text/javascript">$Catalog.registerTab('categories');</script>
+<!-- categories list: end -->
+
+<!-- item tabs: begin -->
+<table cellpadding="0" cellspacing="0">
+ <tr>
+ <inp2:m_DefineElement name="item_tab" title="">
+ <td nowrap="nowrap" width="140">
+ <table id="<inp2:m_param name="prefix"/>_tab" cellpadding="0" cellspacing="0" width="100%" class="catalog-tab-unselected" onclick="$Catalog.switchTab('<inp2:m_param name="prefix"/>');">
+ <tr>
+ <td class="catalog-tab-left">
+ <img src="img/spacer.gif" height="22" width="9" />
+ </td>
+ <td class="catalog-tab-middle" width="100%" valign="middle" nowrap="nowrap">
+ <inp2:m_phrase name="$title"/> <span class="cats_stats">(<span id="<inp2:m_param name="prefix"/>_item_count">?</span>)</span>
+ </td>
+ <td class="catalog-tab-right">
+ <img src="img/spacer.gif" height="22" width="9" />
+ </td>
+ <td style="background-color: #FFFFFF;">
+ <img src="img/spacer.gif" height="1" width="5" />
+ </td>
+ </tr>
+ </table>
+
+ </td>
+ </inp2:m_DefineElement>
+ <inp2:adm_ListCatalogTabs render_as="item_tab" title_property="ViewMenuPhrase" skip_prefixes="m"/>
+ </tr>
+</table>
+<!-- item tabs: end -->
+
+<inp2:m_ModuleInclude template="catalog_tab" tab_init="2" skip_prefixes="m"/>
+
+<inp2:m_include t="incs/footer" noform="yes"/>
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.27.2/kernel/admin_templates/catalog.tpl
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.27
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.27.2/core/units/admin/admin_tag_processor.php
===================================================================
--- branches/unlabeled/unlabeled-1.27.2/core/units/admin/admin_tag_processor.php (nonexistent)
+++ branches/unlabeled/unlabeled-1.27.2/core/units/admin/admin_tag_processor.php (revision 6792)
@@ -0,0 +1,509 @@
+<?php
+
+ class AdminTagProcessor extends kDBTagProcessor {
+
+ function SetConst($params)
+ {
+ $name = $this->SelectParam($params, 'name,const');
+ safeDefine($name, $params['value']);
+ }
+
+ /**
+ * Allows to execute js script after the page is fully loaded
+ *
+ * @param Array $params
+ * @return string
+ */
+ function AfterScript($params)
+ {
+ $after_script = $this->Application->GetVar('after_script');
+ if ($after_script) {
+ return '<script type="text/javascript">'.$after_script.'</script>';
+ }
+ return '';
+ }
+
+ /**
+ * Returns section title with #section# keyword replaced with current section
+ *
+ * @param Array $params
+ * @return string
+ */
+ function GetSectionTitle($params)
+ {
+ $params['name'] = replaceModuleSection($params['phrase']);
+ return $this->Application->ProcessParsedTag('m', 'Phrase', $params);
+ }
+
+ /**
+ * Returns section icon with #section# keyword replaced with current section
+ *
+ * @param Array $params
+ * @return string
+ */
+ function GetSectionIcon($params)
+ {
+ return replaceModuleSection($params['icon']);
+ }
+
+ /**
+ * Allows to detect if current template is one of listed ones
+ *
+ * @param Array $params
+ * @return int
+ */
+ function TemplateMatches($params)
+ {
+ $templates = explode(',' ,$params['templates']);
+ $t = $this->Application->GetVar('t');
+ return in_array($t, $templates) ? 1 : 0;
+ }
+
+ /**
+ * Save return script in cases, when old sections are opened from new sections
+ *
+ * @param Array $params
+ */
+ function SaveReturnScript($params)
+ {
+ // admin/save_redirect.php?do=
+ $url = str_replace($this->Application->BaseURL(), '', $this->Application->ProcessParsedTag('m', 'Link', $params) );
+ $url = explode('?', $url, 2);
+ $url = 'save_redirect.php?'.$url[1].'&do='.$url[0];
+
+ $this->Application->StoreVar('ReturnScript', $url);
+ }
+
+ /**
+ * Redirects to correct next import step template based on import script data
+ *
+ * @param Array $params
+ */
+ function ImportRedirect($params)
+ {
+ $import_id = $this->Application->GetVar('import_id');
+ if ($import_id) {
+ // redirect forward to step3 (import parameters coosing)
+ $this->Application->StoreVar('ImportScriptID', $import_id);
+
+ $sql = 'SELECT *
+ FROM '.TABLE_PREFIX.'ImportScripts
+ WHERE is_id = '.$import_id;
+
+ $db =& $this->Application->GetADODBConnection();
+ $is_params = $db->GetRow($sql);
+
+ if ($is_params['is_type'] == 'db') {
+ $this->Application->Redirect('', null, '', 'import/step3.php');
+ }
+ elseif ($is_params['is_type'] == 'csv') {
+ $module = strtolower($is_params['is_Module']);
+ $template = $module.'/import';
+ $module_info = $this->Application->findModule('Name', $module);
+
+ $item_prefix = $module_info['Var'];
+ $pass_params = Array('m_opener' => 'd', $item_prefix.'.import_id' => 0, $item_prefix.'.import_event' => 'OnNew', 'pass' => 'm,'.$item_prefix.'.import', 'm_cat_id' => $module_info['RootCat']);
+
+ $this->Application->Redirect($template, $pass_params);
+ }
+ }
+ else {
+ // redirect back to step2 (import type choosing)
+ $this->Application->Redirect('', null, '', 'import/step2.php');
+ }
+ }
+
+ /**
+ * Returns version of module by name
+ *
+ * @param Array $params
+ * @return string
+ */
+ function ModuleVersion($params)
+ {
+ return $this->Application->findModule('Name', $params['module'], 'Version');
+ }
+
+ /**
+ * Used in table form section drawing
+ *
+ * @param Array $params
+ * @return string
+ */
+ function DrawTree($params)
+ {
+ static $deep_level = 0;
+
+ // when processings, then sort children by priority (key of children array)
+ $ret = '';
+ $section_name = $params['section_name'];
+ $params['name'] = $this->SelectParam($params, 'name,render_as,block');
+ $sections_helper =& $this->Application->recallObject('SectionsHelper');
+ $section_data =& $sections_helper->getSectionData($section_name);
+
+ $params['children_count'] = isset($section_data['children']) ? count($section_data['children']) : 0;
+ $params['deep_level'] = $deep_level++;
+ $template = $section_data['url']['t'];
+ unset($section_data['url']['t']);
+ $section_data['section_url'] = $this->Application->HREF($template, '', $section_data['url']);
+ $ret .= $this->Application->ParseBlock( array_merge_recursive2($params, $section_data) );
+ if (!isset($section_data['children'])) {
+ return $ret;
+ }
+
+ ksort($section_data['children'], SORT_NUMERIC);
+ foreach ($section_data['children'] as $section_name) {
+ $params['section_name'] = $section_name;
+ $ret .= $this->DrawTree($params);
+ $deep_level--;
+ }
+
+
+ return $ret;
+ }
+
+
+ function PrintSection($params)
+ {
+ $section_name = $params['section_name'];
+ if ($section_name == '#session#') {
+ $section_name = $this->Application->RecallVar('section');
+ }
+
+ $sections_helper =& $this->Application->recallObject('SectionsHelper');
+ $section_data =& $sections_helper->getSectionData($section_name);
+
+ $params['name'] = $this->SelectParam($params, 'name,render_as,block');
+ $params['section_name'] = $section_name;
+
+ $template = $section_data['url']['t'];
+ unset($section_data['url']['t']);
+
+ $section_data['section_url'] = $this->Application->HREF($template, '', $section_data['url']);
+ $ret = $this->Application->ParseBlock( array_merge_recursive2($params, $section_data) );
+
+ return $ret;
+ }
+
+ /**
+ * Used in XML drawing for tree
+ *
+ * @param Array $params
+ * @return string
+ */
+ function PrintSections($params)
+ {
+ // when processings, then sort children by priority (key of children array)
+ $ret = '';
+ $section_name = $params['section_name'];
+ if ($section_name == '#session#') {
+ $section_name = $this->Application->RecallVar('section');
+ }
+
+ $sections_helper =& $this->Application->recallObject('SectionsHelper');
+ $section_data =& $sections_helper->getSectionData($section_name);
+
+ $params['name'] = $this->SelectParam($params, 'name,render_as,block');
+ if (!isset($section_data['children'])) {
+ return '';
+ }
+
+ ksort($section_data['children'], SORT_NUMERIC);
+ foreach ($section_data['children'] as $section_name) {
+ $params['section_name'] = $section_name;
+ $section_data =& $sections_helper->getSectionData($section_name);
+
+ if (isset($section_data['tabs_only']) && $section_data['tabs_only']) {
+ $perm_status = false;
+ $folder_label = $section_data['label'];
+ ksort($section_data['children'], SORT_NUMERIC);
+ foreach ($section_data['children'] as $priority => $section_name) {
+ $perm_status = $this->Application->CheckPermission($section_name.'.view', 1);
+ if ($perm_status) {
+ break;
+ }
+ }
+ if (!$perm_status) {
+ // no permission for all tabs -> don't display tree node either
+ continue;
+ }
+
+ $params['section_name'] = $section_name;
+ $section_data =& $sections_helper->getSectionData($section_name);
+ $section_data['label'] = $folder_label; // use folder label in tree
+ $section_data['is_tab'] = 1;
+ }
+ elseif (!$this->Application->CheckPermission($section_name.'.view', 1)) {
+ continue;
+ }
+
+ $params['children_count'] = isset($section_data['children']) ? count($section_data['children']) : 0;
+
+ $template = $section_data['url']['t'];
+ unset($section_data['url']['t']);
+
+ $section_data['section_url'] = $this->Application->HREF($template, '', $section_data['url']);
+
+ $late_load = getArrayValue($section_data, 'late_load');
+ if ($late_load) {
+ $t = $late_load['t'];
+ unset($late_load['t']);
+ $section_data['late_load'] = $this->Application->HREF($t, '', $late_load);
+ $params['children_count'] = 99;
+ }
+ else {
+ $section_data['late_load'] = '';
+ }
+
+ $ret .= $this->Application->ParseBlock( array_merge_recursive2($params, $section_data) );
+ $params['section_name'] = $section_name;
+ }
+
+ return preg_replace("/\r\n|\n/", '', $ret);
+ }
+
+ function ListSectionPermissions($params)
+ {
+ $section_name = isset($params['section_name']) ? $params['section_name'] : $this->Application->GetVar('section_name');
+ $sections_helper =& $this->Application->recallObject('SectionsHelper');
+ $section_data =& $sections_helper->getSectionData($section_name);
+
+ $block_params = array_merge_recursive2($section_data, Array('name' => $params['render_as'], 'section_name' => $section_name));
+
+ $ret = '';
+ foreach ($section_data['permissions'] as $perm_name) {
+ if (preg_match('/^advanced:(.*)/', $perm_name) != $params['type']) continue;
+ $block_params['perm_name'] = $perm_name;
+ $ret .= $this->Application->ParseBlock($block_params);
+ }
+ return $ret;
+ }
+
+ function ModuleInclude($params)
+ {
+ foreach ($params as $param_name => $param_value) {
+ $params[$param_name] = replaceModuleSection($param_value);
+ }
+
+ return $this->Application->ProcessParsedTag('m', 'ModuleInclude', $params);
+ }
+
+ function TodayDate($params)
+ {
+ return date($params['format']);
+ }
+
+ function TreeEditWarrning($params)
+ {
+ $ret = $this->Application->Phrase($params['label']);
+ $ret = str_replace(Array('&lt;', '&gt;', 'br/', 'br /', "\n", "\r"), Array('<', '>', 'br', 'br', '', ''), $ret);
+ if (getArrayValue($params, 'escape')) {
+ $ret = addslashes($ret);
+ }
+ $ret = str_replace('<br>', '\n', $ret);
+ return $ret;
+ }
+
+ /**
+ * Draws section tabs using block name passed
+ *
+ * @param Array $params
+ */
+ function ListTabs($params)
+ {
+ $sections_helper =& $this->Application->recallObject('SectionsHelper');
+ $section_data =& $sections_helper->getSectionData($params['section_name']);
+
+ $ret = '';
+ $block_params = Array('name' => $params['render_as']);
+ ksort($section_data['children'], SORT_NUMERIC);
+ foreach ($section_data['children'] as $priority => $section_name) {
+ if (!$this->Application->CheckPermission($section_name.'.view', 1)) continue;
+
+ $tab_data =& $sections_helper->getSectionData($section_name);
+ $block_params['t'] = $tab_data['url']['t'];
+ $block_params['title'] = $tab_data['label'];
+ $block_params['main_prefix'] = $section_data['SectionPrefix'];
+ $ret .= $this->Application->ParseBlock($block_params);
+ }
+
+
+ return $ret;
+ }
+
+ /**
+ * Returns list of module item tabs that have view permission in current category
+ *
+ * @param Array $params
+ */
+ function ListCatalogTabs($params)
+ {
+ $ret = '';
+ $special = isset($params['special']) ? $params['special'] : '';
+ $replace_main = isset($params['replace_m']) && $params['replace_m'];
+ $skip_prefixes = isset($params['skip_prefixes']) ? explode(',', $params['skip_prefixes']) : Array();
+ $block_params = Array('name' => $params['render_as']);
+ foreach ($this->Application->ModuleInfo as $module_name => $module_info) {
+ $prefix = $module_info['Var'];
+
+ if (in_array($prefix, $skip_prefixes) || !$this->Application->getUnitOption($prefix, 'CatalogItem')) continue;
+ if ($prefix == 'm' && $replace_main) $prefix = 'c';
+ $label = $this->Application->getUnitOption($prefix, $params['title_property']);
+ $block_params['title'] = $label;
+ $block_params['prefix'] = $prefix;
+ $ret .= $this->Application->ParseBlock($block_params);
+ }
+ return $ret;
+ }
+
+ function FCKEditor($params)
+ {
+ include_once(FULL_PATH.'/admin/editor/cmseditor/fckeditor.php');
+ $oFCKeditor = new FCKeditor($params['name']);
+ $oFCKeditor->BasePath = BASE_PATH.'/admin/editor/cmseditor/';
+ $oFCKeditor->Width = $params['width'] ;
+ $oFCKeditor->Height = $params['height'] ;
+ $oFCKeditor->ToolbarSet = 'Advanced' ;
+ $oFCKeditor->Value = '' ;
+ $oFCKeditor->Config = Array(
+ //'UserFilesPath' => $pathtoroot.'kernel/user_files',
+ 'ProjectPath' => BASE_PATH.'/',
+ 'CustomConfigurationsPath' => $this->Application->BaseURL().'admin/editor/inp_fckconfig.js',
+ 'EditorAreaCSS' => $this->Application->BaseURL().'/themes/inportal_site/inc/inportal.css', //GetThemeCSS(),
+ //'StylesXmlPath' => '../../inp_styles.xml',
+// 'Debug' => 1,
+ 'Admin' => 1,
+ 'K4' => 1,
+ );
+ return $oFCKeditor->CreateHtml();
+
+ }
+
+ /**
+ * Allows to construct link for opening any type of catalog item selector
+ *
+ * @param Array $params
+ * @return string
+ */
+ function SelectorLink($params)
+ {
+ $mode = 'catalog';
+ if (isset($params['mode'])) { // {catalog, advanced_view}
+ $mode = $params['mode'];
+ unset($params['mode']);
+ }
+
+ $params['t'] = 'item_selector/item_selector_'.$mode;
+
+ $default_params = Array('no_amp' => 1, 'pass' => 'all,'.$params['prefix']);
+ unset($params['prefix']);
+
+ $pass_through = Array();
+ if (isset($params['tabs_dependant'])) { // {yes, no}
+ $pass_through['td'] = $params['tabs_dependant'];
+ unset($params['tabs_dependant']);
+ }
+
+ if (isset($params['selection_mode'])) { // {single, multi}
+ $pass_through['tm'] = $params['selection_mode'];
+ unset($params['selection_mode']);
+ }
+
+ if (isset($params['tab_prefixes'])) { // {all, none, <comma separated prefix list}
+ $pass_through['tp'] = $params['tab_prefixes'];
+ unset($params['tab_prefixes']);
+ }
+
+ if ($pass_through) {
+ // add pass_through to selector url if any
+ $params['pass_through'] = implode(',', array_keys($pass_through));
+ $params = array_merge_recursive2($params, $pass_through);
+ }
+
+ // user can override default parameters (except pass_through of course)
+ $params = array_merge_recursive2($default_params, $params);
+
+ return $this->Application->ProcessParsedTag('m', 't', $params);
+ }
+
+ function TimeFrame($params)
+ {
+ $w = adodb_date('w');
+ $m = adodb_date('m');
+ $y = adodb_date('Y');
+ //FirstDayOfWeek is 0 for Sunday and 1 for Monday
+ $fdow = $this->Application->ConfigValue('FirstDayOfWeek');
+ if ($fdow && $w == 0) $w = 7;
+ $today_start = adodb_mktime(0,0,0,adodb_date('m'),adodb_date('d'),$y);
+ $first_day_of_this_week = $today_start - ($w - $fdow)*86400;
+ $first_day_of_this_month = adodb_mktime(0,0,0,$m,1,$y);
+ $this_quater = ceil($m/3);
+ $this_quater_start = adodb_mktime(0,0,0,$this_quater*3-2,1,$y);
+
+ switch ($params['type']) {
+ case 'last_week_start':
+ $timestamp = $first_day_of_this_week - 86400*7;
+ break;
+ case 'last_week_end':
+ $timestamp = $first_day_of_this_week - 1;
+ break;
+
+ case 'last_month_start':
+ $timestamp = $m == 1 ? adodb_mktime(0,0,0,12,1,$y-1) : adodb_mktime(0,0,0,$m-1,1,$y);
+ break;
+ case 'last_month_end':
+ $timestamp = $first_day_of_this_month = adodb_mktime(0,0,0,$m,1,$y) - 1;
+ break;
+
+ case 'last_quater_start':
+ $timestamp = $this_quater == 1 ? adodb_mktime(0,0,0,10,1,$y-1) : adodb_mktime(0,0,0,($this_quater-1)*3-2,1,$y);
+ break;
+ case 'last_quater_end':
+ $timestamp = $this_quater_start - 1;
+ break;
+
+ case 'last_6_months_start':
+ $timestamp = $m <= 6 ? adodb_mktime(0,0,0,$m+6,1,$y-1) : adodb_mktime(0,0,0,$m-6,1,$y);
+ break;
+
+ case 'last_year_start':
+ $timestamp = adodb_mktime(0,0,0,1,1,$y-1);
+ break;
+ case 'last_year_end':
+ $timestamp = adodb_mktime(23,59,59,12,31,$y-1);
+ break;
+ }
+
+
+ if (isset($params['format'])) {
+ $format = $params['format'];
+ if(preg_match("/_regional_(.*)/", $format, $regs))
+ {
+ $lang =& $this->Application->recallObject('lang.current');
+ $format = $lang->GetDBField($regs[1]);
+ }
+ return adodb_date($format, $timestamp);
+ }
+
+ return $timestamp;
+
+ }
+ function CheckPermCache($params)
+ {
+ if ($this->Conn->GetOne('SELECT Data FROM '.TABLE_PREFIX.'Cache WHERE VarName = \'ForcePermCacheUpdate\'')) {
+ $this->Application->Redirect($params['cache_update_t'], array('continue' => 1));
+ }
+ }
+ /**
+ * Checks if current protocol is SSL
+ *
+ * @param Array $params
+ * @return int
+ */
+ function IsSSL($params)
+ {
+ return (PROTOCOL == 'https://')? 1 : 0;
+ }
+ }
+
+?>
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.27.2/core/units/admin/admin_tag_processor.php
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.27
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.27.2/core/admin_templates/catalog/catalog.tpl
===================================================================
--- branches/unlabeled/unlabeled-1.27.2/core/admin_templates/catalog/catalog.tpl (nonexistent)
+++ branches/unlabeled/unlabeled-1.27.2/core/admin_templates/catalog/catalog.tpl (revision 6792)
@@ -0,0 +1,234 @@
+<inp2:m_RequireLogin permissions="in-portal:browse.view" system="1" ajax="yes"/>
+<inp2:m_include t="incs/header" nobody="yes" noform="yes"/>
+
+<body topmargin="0" leftmargin="8" marginheight="0" marginwidth="8" bgcolor="#FFFFFF" onload="$Catalog.Init();">
+<inp2:m_ParseBlock name="section_header" prefix="c" icon="icon46_catalog" module="in-portal" title="!la_title_Browse!"/>
+
+<inp2:m_ParseBlock name="blue_bar" prefix="c" title_preset="catalog" module="in-portal"/>
+
+<!-- main kernel_form: begin -->
+<inp2:m_RenderElement name="kernel_form"/>
+<!-- ToolBar --->
+<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%" border="0">
+<tbody>
+ <tr>
+ <td>
+ <input type="hidden" name="m_cat_id" value="<inp2:m_get name="m_cat_id"/>"/>
+ <script type="text/javascript" src="<inp2:m_TemplatesBase module="in-portal"/>/incs/fw_menu.js"></script>
+ <script type="text/javascript" src="js/ajax.js"></script>
+ <script type="text/javascript" src="<inp2:m_TemplatesBase module="in-portal"/>/incs/catalog.js"></script>
+ <script type="text/javascript">
+ Request.progressText = '<inp2:m_phrase name="la_title_Loading" escape="1"/>';
+ var $is_catalog = true;
+ var $Catalog = new Catalog('<inp2:m_Link template="#TEMPLATE_NAME#" m_cat_id="#CATEGORY_ID#" no_amp="1"/>', 'catalog_');
+ var a_toolbar = new ToolBar();
+
+ a_toolbar.AddButton( new ToolBarButton('in-portal:upcat', '<inp2:m_phrase label="la_ToolTip_Up" escape="1"/>', function() {
+ $Catalog.go_to_cat($Catalog.ParentCategoryID);
+ }
+ ) );
+
+ a_toolbar.AddButton( new ToolBarButton('in-portal:homecat', '<inp2:m_phrase label="la_ToolTip_Home" escape="1"/>', function() {
+ $Catalog.go_to_cat(0);
+ }
+ ) );
+
+ a_toolbar.AddButton( new ToolBarSeparator('sep1') );
+
+ a_toolbar.AddButton( new ToolBarButton('in-portal:new_cat', '<inp2:m_phrase label="la_ToolTip_New_Category" escape="1"/>', function() {
+ std_precreate_item('c', 'in-portal/categories/categories_edit');
+ }
+ ) );
+
+
+ a_toolbar.AddButton( new ToolBarButton('in-portal:editcat', '<inp2:m_phrase label="la_ToolTip_Edit_Current_Category" escape="1"/>', function() {
+ var $edit_url = '<inp2:m_t t="#TEMPLATE#" m_opener="d" c_mode="t" c_event="OnEdit" c_id="#CATEGORY_ID#" pass="all,c" no_amp="1"/>';
+ var $category_id = get_hidden_field('m_cat_id');
+ var $redirect_url = $edit_url.replace('#CATEGORY_ID#', $category_id);
+ $redirect_url = $redirect_url.replace('#TEMPLATE#', $category_id > 0 ? 'in-portal/categories/categories_edit' : 'in-portal/categories/categories_edit_permissions');
+ redirect($redirect_url);
+ }
+ ) );
+
+ <inp2:m_ModuleInclude template="catalog_tab" tab_init="1" skip_prefixes="m"/>
+
+
+ a_toolbar.AddButton( new ToolBarButton('edit', '<inp2:m_phrase label="la_ToolTip_Edit" escape="1"/>', edit) );
+
+ a_toolbar.AddButton( new ToolBarButton('delete', '<inp2:m_phrase label="la_ToolTip_Delete" escape="1"/>',
+ function() {
+ var $template = $Catalog.queryTabRegistry('prefix', $Catalog.getCurrentPrefix(), 'view_template');
+ std_delete_items($Catalog.getCurrentPrefix(), $template, 1);
+ } ) );
+
+
+ a_toolbar.AddButton( new ToolBarSeparator('sep2') );
+
+ a_toolbar.AddButton( new ToolBarButton('approve', '<inp2:m_phrase label="la_ToolTip_Approve" escape="1"/>', function() {
+ $Catalog.submit_event(null, 'OnMassApprove');
+ }
+ ) );
+
+ a_toolbar.AddButton( new ToolBarButton('decline', '<inp2:m_phrase label="la_ToolTip_Decline" escape="1"/>', function() {
+ $Catalog.submit_event(null, 'OnMassDecline');
+ }
+ ) );
+
+ a_toolbar.AddButton( new ToolBarSeparator('sep3') );
+
+ a_toolbar.AddButton( new ToolBarButton('in-portal:export', '<inp2:m_phrase label="la_ToolTip_Export" escape="1"/>', function() {
+ var $export_prefixes = new Array('l', 'p');
+ if (in_array($Catalog.ActivePrefix, $export_prefixes)) {
+ submit_event($Catalog.ActivePrefix, 'OnExport');
+ }
+ else {
+ alert('<inp2:m_phrase name="la_Text_InDevelopment" escape="1"/>');
+ }
+ }
+ ) );
+
+ a_toolbar.AddButton( new ToolBarButton('in-portal:rebuild_cache', '<inp2:m_phrase label="la_ToolTip_RebuildCategoryCache" escape="1"/>', function() {
+ redirect('<inp2:m_t t="in-portal/categories/cache_updater" pass="m"/>');
+ }
+ ) );
+
+ a_toolbar.AddButton( new ToolBarSeparator('sep4') );
+
+
+ a_toolbar.AddButton( new ToolBarButton('in-portal:cut', '<inp2:m_phrase label="la_ToolTip_Cut" escape="1"/>', function() {
+ $Catalog.submit_event(null, 'OnCut');
+ }
+ ) );
+
+ a_toolbar.AddButton( new ToolBarButton('in-portal:copy', '<inp2:m_phrase label="la_ToolTip_Copy" escape="1"/>', function() {
+ $Catalog.submit_event(null, 'OnCopy');
+ }
+ ) );
+
+
+ a_toolbar.AddButton( new ToolBarButton('in-portal:paste', '<inp2:m_phrase label="la_ToolTip_Paste" escape="1"/>', function() {
+ $Catalog.submit_event('c', 'OnPasteClipboard', null, function($object) {
+ $object.resetTabs(true);
+ $object.switchTab();
+ } );
+ }
+ ) );
+
+ /*a_toolbar.AddButton( new ToolBarButton('clear_clipboard', '<inp2:m_phrase label="la_ToolTip_ClearClipboard" escape="1"/>', function() {
+ if (confirm('<inp2:m_phrase name="la_text_ClearClipboardWarning" js_escape="1"/>')) {
+ $Catalog.submit_event('c', 'OnClearClipboard', null, function($object) {
+ $GridManager.CheckDependencies($object.ActivePrefix);
+ } );
+ }
+ }
+ ) );*/
+
+ a_toolbar.AddButton( new ToolBarSeparator('sep5') );
+
+ a_toolbar.AddButton( new ToolBarButton('move_up', '<inp2:m_phrase label="la_ToolTip_Move_Up" escape="1"/>', function() {
+ $Catalog.submit_event(null, 'OnMassMoveUp');
+ }
+ ) );
+
+
+ a_toolbar.AddButton( new ToolBarButton('move_down', '<inp2:m_phrase label="la_ToolTip_Move_Down" escape="1"/>', function() {
+ $Catalog.submit_event(null, 'OnMassMoveDown');
+ }
+ ) );
+
+ a_toolbar.AddButton( new ToolBarSeparator('sep6') );
+
+ a_toolbar.AddButton( new ToolBarButton('view', '<inp2:m_phrase label="la_ToolTip_View" escape="1"/>', function() {
+ show_viewmenu(a_toolbar, 'view');
+ }
+ ) );
+
+ a_toolbar.Render();
+
+ function edit()
+ {
+ var $current_prefix = $Catalog.getCurrentPrefix();
+ $form_name = $Catalog.queryTabRegistry('prefix', $current_prefix, 'tab_id') + '_form';
+ std_edit_item($current_prefix, $Catalog.queryTabRegistry('prefix', $current_prefix, 'edit_template'));
+ }
+ </script>
+ </td>
+ </tr>
+</tbody>
+</table>
+<inp2:m_RenderElement name="kernel_form_end"/>
+<!-- main kernel_form: end -->
+
+<!-- category list: begin -->
+<table id="c_search_warning" width="100%" border="0" cellspacing="0" cellpadding="4" class="table_border_notop" style="display: none">
+ <tr>
+ <td valign="top" class="hint_red">
+ <inp2:m_phrase name="la_Warning_Filter"/>
+ </td>
+ </tr>
+</table>
+
+<inp2:m_set t="in-portal/xml/categories_list"/>
+<inp2:m_RenderElement name="kernel_form" form_name="categories_form"/>
+<table class="toolbar" cellspacing="0" cellpadding="2" width="100%" border="0" class="tableborder_full_a">
+ <tr bgcolor="#e0e0da" height="20">
+ <td width="100%" valign="middle">
+ <img height="15" src="img/arrow.gif" width="15" align="absmiddle" border="0"><span id="category_path"></span>
+ </td>
+ <td align="right">
+ <table cellspacing="0" cellpadding="0" border="0">
+ <tr>
+ <td>Search:&nbsp;</td>
+ <td>
+ <input type="text" id="c_search_keyword" name="c_search_keyword" value="" PrefixSpecial="c" Grid="Default" ajax="1" style="border: 1px solid grey;">
+ <input type="text" style="display: none"; />
+ </td>
+ <td id="search_buttons[c]">
+ <script type="text/javascript">
+ <inp2:m_RenderElement name="grid_search_buttons" PrefixSpecial="c" grid="Default" ajax="1"/>
+ </script>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+</table>
+
+<div id="categories_div" prefix="c" view_template="in-portal/xml/categories_list" edit_template="in-portal/categories/categories_edit" dep_buttons="" class="catalog-tab" style="display: block;"></div>
+<inp2:m_RenderElement name="kernel_form_end"/>
+<inp2:m_set t="in-portal/catalog"/>
+<script type="text/javascript">$Catalog.registerTab('categories');</script>
+<!-- categories list: end -->
+
+<!-- item tabs: begin -->
+<table cellpadding="0" cellspacing="0">
+ <tr>
+ <inp2:m_DefineElement name="item_tab" title="">
+ <td nowrap="nowrap" width="140">
+ <table id="<inp2:m_param name="prefix"/>_tab" cellpadding="0" cellspacing="0" width="100%" class="catalog-tab-unselected" onclick="$Catalog.switchTab('<inp2:m_param name="prefix"/>');">
+ <tr>
+ <td class="catalog-tab-left">
+ <img src="img/spacer.gif" height="22" width="9" />
+ </td>
+ <td class="catalog-tab-middle" width="100%" valign="middle" nowrap="nowrap">
+ <inp2:m_phrase name="$title"/> <span class="cats_stats">(<span id="<inp2:m_param name="prefix"/>_item_count">?</span>)</span>
+ </td>
+ <td class="catalog-tab-right">
+ <img src="img/spacer.gif" height="22" width="9" />
+ </td>
+ <td style="background-color: #FFFFFF;">
+ <img src="img/spacer.gif" height="1" width="5" />
+ </td>
+ </tr>
+ </table>
+
+ </td>
+ </inp2:m_DefineElement>
+ <inp2:adm_ListCatalogTabs render_as="item_tab" title_property="ViewMenuPhrase" skip_prefixes="m"/>
+ </tr>
+</table>
+<!-- item tabs: end -->
+
+<inp2:m_ModuleInclude template="catalog_tab" tab_init="2" skip_prefixes="m"/>
+
+<inp2:m_include t="incs/footer" noform="yes"/>
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.27.2/core/admin_templates/catalog/catalog.tpl
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.27
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property

Event Timeline