Page MenuHomeIn-Portal Phabricator

in-portal
No OneTemporary

File Metadata

Created
Fri, Sep 19, 2:45 AM

in-portal

This document is not UTF8. It was detected as ISO-8859-1 (Latin 1) and converted to UTF8 for display.
Index: branches/unlabeled/unlabeled-1.3.2/kernel/units/modules/modules_tag_processor.php
===================================================================
--- branches/unlabeled/unlabeled-1.3.2/kernel/units/modules/modules_tag_processor.php (nonexistent)
+++ branches/unlabeled/unlabeled-1.3.2/kernel/units/modules/modules_tag_processor.php (revision 5010)
@@ -0,0 +1,12 @@
+<?php
+
+class ModulesTagProcessor extends kDBTagProcessor {
+
+ function ModuleInstalled($params)
+ {
+ return $this->Application->isModuleEnabled($params['name']);
+ }
+
+}
+
+?>
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.3.2/kernel/units/modules/modules_tag_processor.php
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.3
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.3.2/kernel/units/statistics/statistics_tag_processor.php
===================================================================
--- branches/unlabeled/unlabeled-1.3.2/kernel/units/statistics/statistics_tag_processor.php (nonexistent)
+++ branches/unlabeled/unlabeled-1.3.2/kernel/units/statistics/statistics_tag_processor.php (revision 5010)
@@ -0,0 +1,287 @@
+<?php
+
+ class StatisticsTagProcessor extends kDBTagProcessor {
+
+ var $TagCache = Array(); // parsed tag (in sql queries only) values are cached
+
+ var $CurrentSQL = ''; // sql query being currently processed
+ var $PostFormatting = false; // apply formatting to sql query results
+ var $PostFormattingParams = Array(); // post formatting params if any
+
+ function CalculateValue($params)
+ {
+ $object =& $this->getObject($params);
+ $this->CurrentSQL = $object->GetDBField($params['field']);
+
+ // 1. replace prefix to actual one
+ $this->CurrentSQL = str_replace("<%prefix%>", TABLE_PREFIX, $this->CurrentSQL);
+
+ // 2. replace all pseudo-tags found in sql with their values
+ while ( ($tag = $this->FindTag()) != false ) {
+ $this->CurrentSQL = str_replace('<%'.$tag.'%>', $this->ProcessStatisticTag($tag), $this->CurrentSQL);
+ }
+
+ // 3. query sql and process gathered data
+ $values = $this->Conn->GetCol($this->CurrentSQL);
+ if (!$values) return '';
+ if (!$this->PostFormatting) return array_shift($values);
+
+
+ switch ($this->PostFormatting) {
+ case 'number':
+ // simple-specific postformatting
+ $lang =& $this->Application->recallObject('lang.current');
+ $value = $lang->formatNumber($value, $this->PostFormattingParams['precision']);
+ break;
+
+ case 'COUNT':
+ // extended postformatting
+ $value = count($values);
+ break;
+
+ case 'SUM':
+ $value = 0;
+ foreach ($values as $cur_value) {
+ $value += $cur_value;
+ }
+
+ if ($this->PostFormattingParams['format_as'] == 'file') {
+ $value = size($value);
+ }
+ break;
+
+ // other type of information (not from db)
+ case 'SysFileSize':
+ $value = size( dir_size(FULL_PATH.'/') );
+ break;
+
+ default: // simple-default postformatting
+ $value = adodb_date($this->PostFormatting, array_shift($values));
+ break;
+ }
+ $this->PostFormatting = false;
+ $this->PostFormattingParams = Array();
+
+
+ return $value;
+
+ }
+
+ function FindTag()
+ {
+ // finds tag in current sql & returns it if found, false otherwise
+ $tagOpen = '<%'; $tagClose = '%>'; $tagOpenLen = strlen($tagOpen);
+ $startPos = strpos($this->CurrentSQL, $tagOpen);
+ if( $startPos !== false )
+ {
+ $endPos = strpos($this->CurrentSQL, $tagClose, $startPos);
+ return ($endPos > $startPos) ? substr($this->CurrentSQL, $startPos + $tagOpenLen, $endPos - $startPos - $tagOpenLen) : false;
+ }
+ return false;
+ }
+
+ function ProcessStatisticTag($tag)
+ {
+ $tag = trim($tag);
+ if (isset($this->TagCache[$tag])) {
+ return $this->TagCache[$tag];
+ }
+
+ $object =& $this->getObject();
+
+ list($tag_name, $tag_params) = explode(' ', $tag, 2); // 1st - function, 2nd .. nth - params
+ preg_match_all('/([\${}a-zA-Z0-9_.-]+)=(["\']{1,1})(.*?)(?<!\\\)\\2/s', $tag_params, $rets, PREG_SET_ORDER);
+
+ $tag_params = Array();
+ foreach ($rets AS $key => $val){
+ $tag_params[$val[1]] = str_replace(Array('\\' . $val[2], '+'), Array($val[2], ' '), $val[3]);
+ }
+
+ switch ($tag_name) {
+ case 'm:config':
+ // m:config name="<variable_name>"
+ return $this->Application->ConfigValue($tag_params['name']);
+ break;
+
+ case 'm:post_format':
+ // m:post_format field="<field_name>" type="<formatting_type>" precision="2"
+ $lang =& $this->Application->recallObject('lang.current');
+ switch ($tag_params['type']) {
+ case 'date':
+ $this->PostFormatting = $lang->GetDBField('DateFormat');
+ break;
+
+ case 'time':
+ $this->PostFormatting = $lang->GetDBField('TimeFormat');
+ break;
+
+ case 'currency':
+ $this->PostFormatting = 'number';
+ $this->PostFormattingParams['precision'] = $tag_params['precision'];
+ break;
+ }
+ return $tag_params['field'];
+ break;
+
+ case 'm:custom_action':
+ // m:custom_action sql="empty" action="SysFileSize"
+ $this->PostFormatting = $tag_params['action'];
+ return ($tag_params['sql'] == 'empty') ? 'SELECT 1' : $tag_params['sql'];
+ break;
+
+ case 'modules:get_current':
+ return $object->GetDBField('Module');
+ break;
+
+ case 'm:sql_action':
+ //m:sql_action sql="SHOW TABLES" action="COUNT" field="*"
+ $this->PostFormatting = $tag_params['action'];
+ $this->PostFormattingParams = $tag_params;
+ return $tag_params['sql'];
+ break;
+
+ case 'link:hit_count':
+ if ($tag_params['type'] == 'top') {// by now only top is supported
+ $top_links_count = $this->Application->ConfigValue('Link_TopCount');
+
+ $sql = 'SELECT Hits
+ FROM '.TABLE_PREFIX.'Link
+ ORDER BY Hits DESC LIMIT 0, '.$top_links_count;
+ return $this->getLastRecord($sql, 'Hits');
+ }
+ break;
+
+ case 'article:hit_count':
+ if ($tag_params['type'] == 'top') {// by now only top is supported
+ $top_articles_count = $this->Application->ConfigValue('News_VotesToHot');
+ $min_votes = $this->Application->ConfigValue('News_MinVotes');
+
+ $sql = 'SELECT CachedRating
+ FROM '.TABLE_PREFIX.'News
+ WHERE CachedVotesQty > '.$min_votes.'
+ ORDER BY CachedRating DESC LIMIT 0, '.$top_articles_count;
+ return $this->getLastRecord($sql, 'CachedRating');
+ }
+ break;
+
+ case 'topic:hit_count':
+ if ($tag_params['type'] == 'top') {// by now only top is supported
+ $top_posts_count = $this->Application->ConfigValue('Topic_PostsToPop');
+
+ $sql = 'SELECT Views
+ FROM '.TABLE_PREFIX.'Topic
+ ORDER BY Views DESC LIMIT 0, '.$top_posts_count;
+ return $this->getLastRecord($sql, 'Views');
+ }
+ break;
+
+
+ }
+ }
+
+ function getLastRecord($sql, $field)
+ {
+ $records = $this->Conn->GetCol($sql);
+ return count($records) ? array_pop($records) : 0;
+ }
+
+ /**
+ * Allows to get pending item count for prefix
+ *
+ * @param Array $params
+ * @return int
+ */
+ function CountPending($params)
+ {
+ $prefix = $params['prefix'];
+ $value = $this->Application->getCache('statistics.pending', $prefix);
+ if ($value === false) {
+ $statistics_info = $this->Application->getUnitOption($prefix.'.pending', 'StatisticsInfo');
+ if (!$statistics_info) {
+ return 0;
+ }
+
+ $table = $this->Application->getUnitOption($prefix, 'TableName');
+ $status_field = array_shift( $this->Application->getUnitOption($prefix, 'StatusField') );
+ $sql = 'SELECT COUNT(*)
+ FROM '.$table.'
+ WHERE '.$status_field.' = '.$statistics_info['status'];
+ $value = $this->Conn->GetOne($sql);
+ $this->Application->setCache('statistics.pending', $prefix, $value);
+ }
+ return $value;
+ }
+
+ function GetTotalPending()
+ {
+ $sql = 'SELECT Prefix
+ FROM '.TABLE_PREFIX.'ItemTypes
+ WHERE LENGTH(ClassName) > 0';
+ $prefixes = $this->Conn->GetCol($sql);
+
+ $sum = 0;
+ foreach ($prefixes as $prefix) {
+ $sum += $this->CountPending( Array('prefix' => $prefix) );
+ }
+ return $sum;
+ }
+
+ function PrintPendingStatistics($params)
+ {
+ $sql = 'SELECT Prefix
+ FROM '.TABLE_PREFIX.'ItemTypes
+ WHERE LENGTH(ClassName) > 0';
+ $check_prefixes = $this->Conn->GetCol($sql);
+ if (!$check_prefixes) {
+ return '';
+ }
+
+ $ret = '';
+ $columns = $params['columns'];
+ $block_params = $this->prepareTagParams( Array('name' => $this->SelectParam($params, 'render_as,block') ) );
+
+ $prefixes = Array();
+ foreach ($check_prefixes as $prefix) {
+ $statistics_info = $this->Application->getUnitOption($prefix.'.pending', 'StatisticsInfo');
+ if ($statistics_info) {
+ $prefixes[] = $prefix;
+ }
+ }
+
+ $row_number = 0;
+
+ foreach ($prefixes as $i => $prefix) {
+ $block_params['prefix'] = $prefix;
+ $statistics_info = $this->Application->getUnitOption($prefix.'.pending', 'StatisticsInfo');
+
+ if ($i % $columns == 0) {
+ $column_number = 1;
+ $ret .= '<tr>';
+ }
+
+ $block_params['column_number'] = $column_number;
+ $block_params['is_first'] = $i < $columns ? 1 : 0;
+ $template = $statistics_info['url']['t'];
+ unset($statistics_info['url']['t']);
+ $url = $this->Application->HREF($template, '', $statistics_info['url']);
+ if ($statistics_info['js_url'] != '#url#') {
+ $statistics_info['js_url'] = 'javascript:'.$statistics_info['js_url'];
+ }
+
+ $block_params['url'] = str_replace('#url#', $url, $statistics_info['js_url']);
+ $block_params['icon'] = $statistics_info['icon'];
+ $block_params['label'] = $statistics_info['label'];
+ $ret .= $this->Application->ParseBlock($block_params);
+ $column_number++;
+
+ if (($i+1) % $columns == 0) {
+ $ret .= '</tr>';
+ }
+ }
+ return $ret;
+ }
+
+ }
+
+
+?>
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.3.2/kernel/units/statistics/statistics_tag_processor.php
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.3
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.3.2/kernel/admin_templates/groups/groups_edit.tpl
===================================================================
--- branches/unlabeled/unlabeled-1.3.2/kernel/admin_templates/groups/groups_edit.tpl (nonexistent)
+++ branches/unlabeled/unlabeled-1.3.2/kernel/admin_templates/groups/groups_edit.tpl (revision 5010)
@@ -0,0 +1,71 @@
+<inp2:m_RequireLogin permissions="in-portal:user_groups.view" system="1"/>
+<inp2:m_include t="incs/header" nobody="yes"/>
+
+<body topmargin="0" leftmargin="8" marginheight="0" marginwidth="8" bgcolor="#FFFFFF">
+<inp2:m_ParseBlock name="section_header" prefix="g" icon="icon46_usergroups" module="in-portal" title="!la_title_Groups!"/>
+
+<inp2:m_include t="groups/groups_edit_tabs"/>
+
+<inp2:m_ParseBlock name="blue_bar" prefix="g" title_preset="groups_edit" module="in-portal" icon="icon46_usergroups"/>
+
+<!-- ToolBar --->
+<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%" border="0">
+<tbody>
+ <tr>
+ <td>
+ <script type="text/javascript">
+ a_toolbar = new ToolBar();
+ a_toolbar.AddButton( new ToolBarButton('select', '<inp2:m_phrase label="la_ToolTip_Save" escape="1"/>', function() {
+ submit_event('g','<inp2:g_SaveEvent/>');
+ }
+ ) );
+ a_toolbar.AddButton( new ToolBarButton('cancel', '<inp2:m_phrase label="la_ToolTip_Cancel" escape="1"/>', function() {
+ submit_event('g','OnCancelEdit');
+ }
+ ) );
+
+ a_toolbar.AddButton( new ToolBarSeparator('sep1') );
+
+ a_toolbar.AddButton( new ToolBarButton('prev', '<inp2:m_phrase label="la_ToolTip_Prev" escape="1"/>', function() {
+ go_to_id('g', '<inp2:g_PrevId/>');
+ }
+ ) );
+ a_toolbar.AddButton( new ToolBarButton('next', '<inp2:m_phrase label="la_ToolTip_Next" escape="1"/>', function() {
+ go_to_id('g', '<inp2:g_NextId/>');
+ }
+ ) );
+
+ a_toolbar.Render();
+
+ <inp2:m_if prefix="g" function="IsSingle"/>
+ a_toolbar.HideButton('prev');
+ a_toolbar.HideButton('next');
+ a_toolbar.HideButton('sep1');
+ <inp2:m_else/>
+ <inp2:m_if prefix="g" function="IsLast"/>
+ a_toolbar.DisableButton('next');
+ <inp2:m_endif/>
+ <inp2:m_if prefix="g" function="IsFirst"/>
+ a_toolbar.DisableButton('prev');
+ <inp2:m_endif/>
+ <inp2:m_endif/>
+ </script>
+ </td>
+ </tr>
+</tbody>
+</table>
+
+<inp2:g_SaveWarning name="grid_save_warning"/>
+<table width="100%" border="0" cellspacing="0" cellpadding="4" class="tableborder">
+ <inp2:m_ParseBlock name="subsection" title="!la_section_General!"/>
+ <inp2:m_ParseBlock name="inp_id_label" prefix="g" field="GroupId" title="!la_fld_GroupId!"/>
+ <inp2:m_ParseBlock name="inp_edit_box" prefix="g" field="Name" title="!la_fld_GroupName!"/>
+ <inp2:m_ParseBlock name="inp_edit_textarea" prefix="g" field="Description" title="!la_fld_Comments!" rows="5" cols="30"/>
+
+ <inp2:m_if check="m_IsDebugMode">
+ <inp2:m_ParseBlock name="inp_edit_radio" prefix="g" field="Enabled" title="!la_fld_Enabled!" use_phrases="1"/>
+ </inp2:m_if>
+</table>
+
+<inp2:m_include t="incs/footer"/>
+
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.3.2/kernel/admin_templates/groups/groups_edit.tpl
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.3
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.3.2/kernel/admin_templates/groups/groups_list.tpl
===================================================================
--- branches/unlabeled/unlabeled-1.3.2/kernel/admin_templates/groups/groups_list.tpl (nonexistent)
+++ branches/unlabeled/unlabeled-1.3.2/kernel/admin_templates/groups/groups_list.tpl (revision 5010)
@@ -0,0 +1,61 @@
+<inp2:m_RequireLogin permissions="in-portal:user_groups.view" system="1"/>
+<inp2:m_include t="incs/header" nobody="yes"/>
+
+<body topmargin="0" leftmargin="8" marginheight="0" marginwidth="8" bgcolor="#FFFFFF">
+
+<inp2:m_ParseBlock name="section_header" prefix="g" icon="icon46_usergroups" module="in-portal" title="!la_title_Groups!"/>
+
+<inp2:m_ParseBlock name="blue_bar" prefix="g.total" title_preset="groups_list" module="in-portal" icon="icon46_usergroups"/>
+
+<!-- ToolBar --->
+<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%" border="0">
+<tbody>
+ <tr>
+ <td>
+ <script type="text/javascript">
+ //do not rename - this function is used in default grid for double click!
+ function edit()
+ {
+ set_hidden_field('remove_specials[g.total]', 1);
+ std_edit_item('g.total', 'groups/groups_edit');
+ }
+
+ var a_toolbar = new ToolBar();
+ a_toolbar.AddButton( new ToolBarButton('new_group', '<inp2:m_phrase label="la_ToolTip_New_CustomField" escape="1"/>',
+ function() {
+ set_hidden_field('remove_specials[g.total]', 1);
+ std_precreate_item('g.total', 'groups/groups_edit')
+ } ) );
+
+ 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() {
+ set_hidden_field('remove_specials[g.total]', 1);
+ std_delete_items('g.total');
+ } ) );
+
+ a_toolbar.AddButton( new ToolBarSeparator('sep1') );
+
+ a_toolbar.AddButton( new ToolBarButton('e-mail', '<inp2:m_phrase label="la_ToolTip_SendMail" escape="1"/>', function() {
+ openEmailSend('<inp2:m_t t="sendmail" index_file="email/sendmail.php" pass="m" escape="1"/>', 'group', 'g.total');
+ }
+ ) );
+
+ a_toolbar.AddButton( new ToolBarButton('view', '<inp2:m_phrase label="la_ToolTip_View" escape="1"/>', function() {
+ show_viewmenu(a_toolbar,'view');
+ }
+ ) );
+
+ a_toolbar.Render();
+ </script>
+
+ </td>
+ </tr>
+</tbody>
+</table>
+
+<inp2:m_ParseBlock name="grid" PrefixSpecial="g.total" IdField="GroupId" grid="Default"/>
+<script type="text/javascript">
+ Grids['g.total'].SetDependantToolbarButtons( new Array('edit', 'delete', 'e-mail') );
+</script>
+<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.3.2/kernel/admin_templates/groups/groups_list.tpl
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.3
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.3.2/kernel/admin_templates/login.tpl
===================================================================
--- branches/unlabeled/unlabeled-1.3.2/kernel/admin_templates/login.tpl (nonexistent)
+++ branches/unlabeled/unlabeled-1.3.2/kernel/admin_templates/login.tpl (revision 5010)
@@ -0,0 +1,83 @@
+<inp2:m_include t="incs/header" nobody="yes"/>
+
+<body topmargin="0" leftmargin="8" marginheight="0" marginwidth="8" bgcolor="#FFFFFF" text="#000000" onLoad="document.getElementById($form_name).login.focus();">
+ <inp2:m_ParseBlock name="kernel_form"/>
+ <table width="100%" border="0" cellspacing="0" cellpadding="0" height="100%">
+ <tr>
+ <td valign="middle" align="center">
+ <div align="center">
+ <img title="In-portal" src="img/globe.gif" width="84" height="82" border="0">
+ <img title="In-portal" src="img/logo.gif" width="150" height="82" border="0"><br />
+
+
+ <table border="0" cellpadding="2" cellspacing="0" class="tableborder_full" width="222" height="30">
+ <tr>
+ <td align="right" valign="top" class="tablenav" width ="220" nowrap height="30" style="background: url(img/tabnav_left.gif);">
+ <span style="float: left;">
+ <img src="img/icons/icon24_lock_login.gif" width="16" height="22" alt="" border="0" align="absmiddle"> <inp2:m_phrase name="la_Login"/>
+ </span>
+ <a href="help/manual.pdf"><img src="img/blue_bar_help.gif" border="0"></a>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2" bgcolor="#F0F0F0">
+ <table cellpadding="4" cellspacing="0" border="0">
+ <tr bgcolor="#F0F0F0">
+ <td class="text"><inp2:m_phrase name="la_Text_Login"/></td>
+ <td><input type="text" name="login" class="text" onkeypress="catchHotKeysA(event);"></td>
+ </tr>
+ <tr bgcolor="#F0F0F0">
+ <td class="text"><inp2:m_phrase name="la_prompt_Password"/></td>
+ <td><input type="password" name="password" class="text" onKeyPress="catchHotKeysA(event);"></td>
+ </tr>
+ <tr bgcolor="#F0F0F0">
+ <td colspan="2">
+ <div align="left">
+ <input type="submit" name="login_button" onclick="doLogin();" value="<inp2:m_phrase name="la_Login"/>" class="button">
+ <input type="reset" name="cancel_button" value="<inp2:m_phrase name="la_Cancel"/>" class="button">
+ </div>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ </table>
+ <inp2:m_if check="u_HasError" field="any">
+ <p class="error"><inp2:u_Error field="ValidateLogin"/></p
+ </inp2:m_if>
+ </td>
+ </tr>
+ </table>
+ <input type="hidden" name="next_template" value="<inp2:m_if check="m_GetEquals" name="next_template" value="">index<inp2:m_else/><inp2:m_get var="next_template"/></inp2:m_if>">
+
+ <script type="text/javascript">
+ function doLogin()
+ {
+ submit_event('u', 'OnLogin');
+ }
+
+ function catchHotKeysA(e)
+ {
+ if (!e) return;
+ if (e.keyCode == 13) doLogin();
+ }
+
+ var a_parent = window.parent;
+ function redirect()
+ {
+ window.name = 'redirect';
+ var i = 0;
+ while (i < 10) {
+ if (window.parent.name == 'main_frame') break;
+ a_parent = window.parent;
+ i++;
+ }
+ page = '<inp2:m_t t="index" expired="1" escape="1" no_amp="1"/>'; // a_parent.location.href + '?expired=1';
+ if (i < 10) {
+ setTimeout('a_parent.location.href=page',100);
+ }
+ }
+ redirect();
+ </script>
+
+<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.3.2/kernel/admin_templates/login.tpl
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.3
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.3.2/kernel/admin/include/help/editcategory_general.txt
===================================================================
--- branches/unlabeled/unlabeled-1.3.2/kernel/admin/include/help/editcategory_general.txt (nonexistent)
+++ branches/unlabeled/unlabeled-1.3.2/kernel/admin/include/help/editcategory_general.txt (revision 5010)
@@ -0,0 +1,18 @@
+<ul>
+<li> Enable HTML? – this check box enables or disables HTML code in the category name and the category description. When checked, it will render the HTML (for example, a &lt;B&gt; tag will actually make the text bold). When unchecked, it will display the HTML as regular text (the &lt;B&gt; tag will appear exactly as ‘&lt;B&gt;'). This is very important, since some HTML tags can break the page layout, and in some instances can be a security weakness (the Java Script, for example).
+<li> Category ID - this is a read-only field that displays the internal system ID. It is of a small importance, other than the fact that it's a truly unique identifier of a category – there can never be two categories with the same ID.
+<li> Name - this is the category name
+<li> Description - this is the category description
+<li> Automatic Directory Name – specifies whether the Directory Name used for mod_rewrite should be generated automatically from the category name, or entered manually. If checked, the Directory Name will be generated from the category name, replacing all special characters ( !@#$%^&*()+|\=-~`{}][:”’;,./?>< ) by the underscore character (“_”), and all multiple underscores with a single underscore. If the resulting name ends with an underscore followed by number, an additional letter will be appended, since the names ending with a number are reserved for system use. The resulting name will also be checked for uniqueness, and if it’s not unique, additional letters will be appended to the end of the name
+<li>Directory Name – the directory name used for the URL generation when using mod_rewrite. The field is disabled if Automatic Directory Name is On. If Automatic Directory Name is Off, the administrator may enter the directory name manually, however it will still be checked for uniqueness, special characters and whether it ends with a number. In such cases the Directory Name will be automatically corrected before saving.
+<li>Category Temple – the template file name used for displaying category index (item listing). If not explicitly set, the template filename will be inherited from the parent category, or taken from the URL if present. When used in conjunction with mod_rewrite, the template name will be eliminated from the URLs pointing to the category index, deduced by matching the category name from the URLs. The Category Template may be set to different values for different categories providing the ability to adjust the design of different categories.
+<li>Item Template – the template file name used for displaying items (such as links, products, articles etc) inside the given category. Works exactly the same way as the Category Template, except it’s used for URLs pointing to an item.
+
+<li> ‘Editor' – this icon that looks like a notepad and a pen, will pop up the online HTML editor for the category description. It will only work if the Enable HTML check box is checked.
+<li> Status – this is the category status
+<li> New – this is the control for the ‘New' flag. The ‘auto' setting will let the system set the ‘new' flag automatically, based on the number of days since its creation and a setting; ‘always' will enable the flag, and ‘never' will disable it.
+<li> Editor's Pick – this sets the Editor's pick flag
+<li> Created on – this is the creation date. It can be either entered directly into the field, or you can use the calendar tool to select a date. The ‘Calendar' button is an icon to the right of the field that looks like a date book page. To the right of the ‘Calendar' button there is a hint that shows the current date format. This format may change, if a different Regional package is activated.
+<li> META keywords – this field contains the META keywords that will be displayed on the front end of the In-portal site, in the special HTML “meta” tags. These particular keywords will be displayed when the current category is entered.
+META description – similar to the META keywords, but for the META description HTML tag. Both are useful for search engine recognition of the page, as well as alternative descriptions of the category that will not be visible to a human visitor.
+</ul>
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.3.2/kernel/admin/include/help/editcategory_general.txt
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.3
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.3.2/admin/install/upgrades/inportal_upgrade_v1.2.0.sql
===================================================================
--- branches/unlabeled/unlabeled-1.3.2/admin/install/upgrades/inportal_upgrade_v1.2.0.sql (nonexistent)
+++ branches/unlabeled/unlabeled-1.3.2/admin/install/upgrades/inportal_upgrade_v1.2.0.sql (revision 5010)
@@ -0,0 +1,105 @@
+INSERT INTO Events (Event, Enabled, FromUserId, Module, Description, Type) VALUES ('COMMON.FOOTER', 1, 0, 'In-Portal', 'la_event_common.footer', 1);
+ALTER TABLE CustomField ADD IsSystem TINYINT UNSIGNED NOT NULL;
+
+ALTER TABLE CategoryCustomData ADD INDEX (ResourceId);
+ALTER TABLE PortalUserCustomData ADD INDEX (ResourceId);
+
+ALTER TABLE Permissions CHANGE Permission Permission VARCHAR(255) NOT NULL;
+INSERT INTO ConfigurationValues VALUES ('NoPermissionTemplate', 'no_permission', 'In-Portal', 'in-portal:configure_general');
+INSERT INTO ConfigurationAdmin VALUES ('NoPermissionTemplate', 'la_Text_Website', 'la_config_nopermission_template', 'text', '', '', 17, 0);
+
+ALTER TABLE ConfigurationValues DROP PRIMARY KEY;
+ALTER TABLE ConfigurationValues ADD VariableId INT NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST ;
+ALTER TABLE ConfigurationValues ADD UNIQUE (VariableName);
+
+ALTER TABLE PhraseCache ADD ConfigVariables text;
+
+UPDATE ConfigurationAdmin SET ValueList = '0=lu_none,<SQL>SELECT GroupId AS OptionName, CONCAT(''+'', Name) AS OptionValue FROM <PREFIX>PortalGroup WHERE Enabled=1 AND Personal=0</SQL>' WHERE VariableName IN ('User_NewGroup','User_GuestGroup','User_SubscriberGroup','User_LoggedInGroup');
+
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:root.view', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:site.view', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:browse.view', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:advanced_view.view', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:reviews.view', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:configure_categories.view', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:configure_categories.edit', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:configuration_search.view', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:configuration_search.edit', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:configuration_email.view', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:configuration_email.edit', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:configuration_custom.view', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:configuration_custom.add', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:configuration_custom.edit', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:configuration_custom.delete', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:users.view', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:user_list.view', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:user_list.add', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:user_list.edit', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:user_list.delete', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:user_list.advanced:ban', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:user_list.advanced:send_email', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:user_groups.view', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:user_groups.add', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:user_groups.edit', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:user_groups.delete', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:user_groups.advanced:send_email', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:configure_users.view', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:configure_users.edit', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:user_email.view', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:user_email.edit', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:user_custom.view', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:user_custom.add', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:user_custom.edit', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:user_custom.delete', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:user_banlist.view', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:user_banlist.add', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:user_banlist.edit', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:user_banlist.delete', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:reports.view', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:log_summary.view', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:searchlog.view', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:searchlog.delete', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:sessionlog.view', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:sessionlog.delete', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:emaillog.view', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:emaillog.delete', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:visits.view', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:visits.delete', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:system.view', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:configure_general.view', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:configure_general.edit', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:modules.view', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:mod_status.view', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:mod_status.edit', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:mod_status.advanced:approve', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:mod_status.advanced:decline', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:addmodule.view', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:addmodule.add', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:addmodule.edit', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:tag_library.view', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:configure_themes.view', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:configure_themes.add', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:configure_themes.edit', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:configure_themes.delete', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:configure_styles.view', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:configure_styles.add', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:configure_styles.edit', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:configure_styles.delete', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:configure_lang.view', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:configure_lang.add', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:configure_lang.edit', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:configure_lang.delete', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:configure_lang.advanced:set_primary', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:configure_lang.advanced:import', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:configure_lang.advanced:export', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:tools.view', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:backup.view', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:restore.view', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:export.view', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:main_import.view', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:sql_query.view', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:sql_query.edit', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:server_info.view', 11, 1, 1, 0);
+INSERT INTO Permissions (Permission, GroupId, PermissionValue, Type, CatId) VALUES ('in-portal:help.view', 11, 1, 1, 0);
+
+UPDATE Modules SET Version = '1.2.0' WHERE Name = 'In-Portal';
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.3.2/admin/install/upgrades/inportal_upgrade_v1.2.0.sql
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.3
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.3.2/core/kernel/utility/debugger/debugger.css
===================================================================
--- branches/unlabeled/unlabeled-1.3.2/core/kernel/utility/debugger/debugger.css (nonexistent)
+++ branches/unlabeled/unlabeled-1.3.2/core/kernel/utility/debugger/debugger.css (revision 5010)
@@ -0,0 +1,71 @@
+.dbg_profiler {
+ margin-top: 5px;
+ padding: 0px;
+ height: 10px;
+ border: 1px solid #000000;
+ float: left;
+ display: inline;
+}
+
+.dbg_flat_table, .dbg_stats_table {
+ border-collapse: collapse;
+ width: auto;
+ margin: 0px;
+}
+
+.dbg_flat_table TD, .dbg_stats_table TD {
+ border: 1px solid #CCCCCC;
+ padding: 4px;
+}
+
+.dbg_stats_table TD {
+ font-family: Arial, Verdana;
+ font-size: 9pt;
+}
+
+.debug_layer_table {
+ border-collapse: collapse;
+}
+
+.debug_text, .debug_row_even TD, .debug_row_odd TD {
+ color: #000000;
+ font-family: Verdana;
+ font-size: 11px;
+}
+
+.debug_cell {
+ border: 1px solid #FF0000;
+ padding: 4px;
+ text-align: left;
+}
+
+.debug_row_even {
+ background-color: #CCCCFF;
+}
+
+.debug_row_odd {
+ background-color: #FFFFCC;
+}
+
+.debug_layer_container {
+ left: 2px;
+ top: 1px;
+ z-index: +1000;
+ position: absolute;
+ overflow: auto;
+ border: 2px solid;
+ padding: 3px;
+ border-top-color: threedlightshadow;
+ border-left-color: threedlightshadow;
+ border-right-color: threeddarkshadow;
+ border-bottom-color: threeddarkshadow;
+ background-color: buttonface;
+}
+
+.debug_layer {
+ padding: 0px;
+}
+
+.debug_error {
+ color: #FF0000;
+}
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.3.2/core/kernel/utility/debugger/debugger.css
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.3
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.3.2/core/units/statistics/statistics_tag_processor.php
===================================================================
--- branches/unlabeled/unlabeled-1.3.2/core/units/statistics/statistics_tag_processor.php (nonexistent)
+++ branches/unlabeled/unlabeled-1.3.2/core/units/statistics/statistics_tag_processor.php (revision 5010)
@@ -0,0 +1,287 @@
+<?php
+
+ class StatisticsTagProcessor extends kDBTagProcessor {
+
+ var $TagCache = Array(); // parsed tag (in sql queries only) values are cached
+
+ var $CurrentSQL = ''; // sql query being currently processed
+ var $PostFormatting = false; // apply formatting to sql query results
+ var $PostFormattingParams = Array(); // post formatting params if any
+
+ function CalculateValue($params)
+ {
+ $object =& $this->getObject($params);
+ $this->CurrentSQL = $object->GetDBField($params['field']);
+
+ // 1. replace prefix to actual one
+ $this->CurrentSQL = str_replace("<%prefix%>", TABLE_PREFIX, $this->CurrentSQL);
+
+ // 2. replace all pseudo-tags found in sql with their values
+ while ( ($tag = $this->FindTag()) != false ) {
+ $this->CurrentSQL = str_replace('<%'.$tag.'%>', $this->ProcessStatisticTag($tag), $this->CurrentSQL);
+ }
+
+ // 3. query sql and process gathered data
+ $values = $this->Conn->GetCol($this->CurrentSQL);
+ if (!$values) return '';
+ if (!$this->PostFormatting) return array_shift($values);
+
+
+ switch ($this->PostFormatting) {
+ case 'number':
+ // simple-specific postformatting
+ $lang =& $this->Application->recallObject('lang.current');
+ $value = $lang->formatNumber($value, $this->PostFormattingParams['precision']);
+ break;
+
+ case 'COUNT':
+ // extended postformatting
+ $value = count($values);
+ break;
+
+ case 'SUM':
+ $value = 0;
+ foreach ($values as $cur_value) {
+ $value += $cur_value;
+ }
+
+ if ($this->PostFormattingParams['format_as'] == 'file') {
+ $value = size($value);
+ }
+ break;
+
+ // other type of information (not from db)
+ case 'SysFileSize':
+ $value = size( dir_size(FULL_PATH.'/') );
+ break;
+
+ default: // simple-default postformatting
+ $value = adodb_date($this->PostFormatting, array_shift($values));
+ break;
+ }
+ $this->PostFormatting = false;
+ $this->PostFormattingParams = Array();
+
+
+ return $value;
+
+ }
+
+ function FindTag()
+ {
+ // finds tag in current sql & returns it if found, false otherwise
+ $tagOpen = '<%'; $tagClose = '%>'; $tagOpenLen = strlen($tagOpen);
+ $startPos = strpos($this->CurrentSQL, $tagOpen);
+ if( $startPos !== false )
+ {
+ $endPos = strpos($this->CurrentSQL, $tagClose, $startPos);
+ return ($endPos > $startPos) ? substr($this->CurrentSQL, $startPos + $tagOpenLen, $endPos - $startPos - $tagOpenLen) : false;
+ }
+ return false;
+ }
+
+ function ProcessStatisticTag($tag)
+ {
+ $tag = trim($tag);
+ if (isset($this->TagCache[$tag])) {
+ return $this->TagCache[$tag];
+ }
+
+ $object =& $this->getObject();
+
+ list($tag_name, $tag_params) = explode(' ', $tag, 2); // 1st - function, 2nd .. nth - params
+ preg_match_all('/([\${}a-zA-Z0-9_.-]+)=(["\']{1,1})(.*?)(?<!\\\)\\2/s', $tag_params, $rets, PREG_SET_ORDER);
+
+ $tag_params = Array();
+ foreach ($rets AS $key => $val){
+ $tag_params[$val[1]] = str_replace(Array('\\' . $val[2], '+'), Array($val[2], ' '), $val[3]);
+ }
+
+ switch ($tag_name) {
+ case 'm:config':
+ // m:config name="<variable_name>"
+ return $this->Application->ConfigValue($tag_params['name']);
+ break;
+
+ case 'm:post_format':
+ // m:post_format field="<field_name>" type="<formatting_type>" precision="2"
+ $lang =& $this->Application->recallObject('lang.current');
+ switch ($tag_params['type']) {
+ case 'date':
+ $this->PostFormatting = $lang->GetDBField('DateFormat');
+ break;
+
+ case 'time':
+ $this->PostFormatting = $lang->GetDBField('TimeFormat');
+ break;
+
+ case 'currency':
+ $this->PostFormatting = 'number';
+ $this->PostFormattingParams['precision'] = $tag_params['precision'];
+ break;
+ }
+ return $tag_params['field'];
+ break;
+
+ case 'm:custom_action':
+ // m:custom_action sql="empty" action="SysFileSize"
+ $this->PostFormatting = $tag_params['action'];
+ return ($tag_params['sql'] == 'empty') ? 'SELECT 1' : $tag_params['sql'];
+ break;
+
+ case 'modules:get_current':
+ return $object->GetDBField('Module');
+ break;
+
+ case 'm:sql_action':
+ //m:sql_action sql="SHOW TABLES" action="COUNT" field="*"
+ $this->PostFormatting = $tag_params['action'];
+ $this->PostFormattingParams = $tag_params;
+ return $tag_params['sql'];
+ break;
+
+ case 'link:hit_count':
+ if ($tag_params['type'] == 'top') {// by now only top is supported
+ $top_links_count = $this->Application->ConfigValue('Link_TopCount');
+
+ $sql = 'SELECT Hits
+ FROM '.TABLE_PREFIX.'Link
+ ORDER BY Hits DESC LIMIT 0, '.$top_links_count;
+ return $this->getLastRecord($sql, 'Hits');
+ }
+ break;
+
+ case 'article:hit_count':
+ if ($tag_params['type'] == 'top') {// by now only top is supported
+ $top_articles_count = $this->Application->ConfigValue('News_VotesToHot');
+ $min_votes = $this->Application->ConfigValue('News_MinVotes');
+
+ $sql = 'SELECT CachedRating
+ FROM '.TABLE_PREFIX.'News
+ WHERE CachedVotesQty > '.$min_votes.'
+ ORDER BY CachedRating DESC LIMIT 0, '.$top_articles_count;
+ return $this->getLastRecord($sql, 'CachedRating');
+ }
+ break;
+
+ case 'topic:hit_count':
+ if ($tag_params['type'] == 'top') {// by now only top is supported
+ $top_posts_count = $this->Application->ConfigValue('Topic_PostsToPop');
+
+ $sql = 'SELECT Views
+ FROM '.TABLE_PREFIX.'Topic
+ ORDER BY Views DESC LIMIT 0, '.$top_posts_count;
+ return $this->getLastRecord($sql, 'Views');
+ }
+ break;
+
+
+ }
+ }
+
+ function getLastRecord($sql, $field)
+ {
+ $records = $this->Conn->GetCol($sql);
+ return count($records) ? array_pop($records) : 0;
+ }
+
+ /**
+ * Allows to get pending item count for prefix
+ *
+ * @param Array $params
+ * @return int
+ */
+ function CountPending($params)
+ {
+ $prefix = $params['prefix'];
+ $value = $this->Application->getCache('statistics.pending', $prefix);
+ if ($value === false) {
+ $statistics_info = $this->Application->getUnitOption($prefix.'.pending', 'StatisticsInfo');
+ if (!$statistics_info) {
+ return 0;
+ }
+
+ $table = $this->Application->getUnitOption($prefix, 'TableName');
+ $status_field = array_shift( $this->Application->getUnitOption($prefix, 'StatusField') );
+ $sql = 'SELECT COUNT(*)
+ FROM '.$table.'
+ WHERE '.$status_field.' = '.$statistics_info['status'];
+ $value = $this->Conn->GetOne($sql);
+ $this->Application->setCache('statistics.pending', $prefix, $value);
+ }
+ return $value;
+ }
+
+ function GetTotalPending()
+ {
+ $sql = 'SELECT Prefix
+ FROM '.TABLE_PREFIX.'ItemTypes
+ WHERE LENGTH(ClassName) > 0';
+ $prefixes = $this->Conn->GetCol($sql);
+
+ $sum = 0;
+ foreach ($prefixes as $prefix) {
+ $sum += $this->CountPending( Array('prefix' => $prefix) );
+ }
+ return $sum;
+ }
+
+ function PrintPendingStatistics($params)
+ {
+ $sql = 'SELECT Prefix
+ FROM '.TABLE_PREFIX.'ItemTypes
+ WHERE LENGTH(ClassName) > 0';
+ $check_prefixes = $this->Conn->GetCol($sql);
+ if (!$check_prefixes) {
+ return '';
+ }
+
+ $ret = '';
+ $columns = $params['columns'];
+ $block_params = $this->prepareTagParams( Array('name' => $this->SelectParam($params, 'render_as,block') ) );
+
+ $prefixes = Array();
+ foreach ($check_prefixes as $prefix) {
+ $statistics_info = $this->Application->getUnitOption($prefix.'.pending', 'StatisticsInfo');
+ if ($statistics_info) {
+ $prefixes[] = $prefix;
+ }
+ }
+
+ $row_number = 0;
+
+ foreach ($prefixes as $i => $prefix) {
+ $block_params['prefix'] = $prefix;
+ $statistics_info = $this->Application->getUnitOption($prefix.'.pending', 'StatisticsInfo');
+
+ if ($i % $columns == 0) {
+ $column_number = 1;
+ $ret .= '<tr>';
+ }
+
+ $block_params['column_number'] = $column_number;
+ $block_params['is_first'] = $i < $columns ? 1 : 0;
+ $template = $statistics_info['url']['t'];
+ unset($statistics_info['url']['t']);
+ $url = $this->Application->HREF($template, '', $statistics_info['url']);
+ if ($statistics_info['js_url'] != '#url#') {
+ $statistics_info['js_url'] = 'javascript:'.$statistics_info['js_url'];
+ }
+
+ $block_params['url'] = str_replace('#url#', $url, $statistics_info['js_url']);
+ $block_params['icon'] = $statistics_info['icon'];
+ $block_params['label'] = $statistics_info['label'];
+ $ret .= $this->Application->ParseBlock($block_params);
+ $column_number++;
+
+ if (($i+1) % $columns == 0) {
+ $ret .= '</tr>';
+ }
+ }
+ return $ret;
+ }
+
+ }
+
+
+?>
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.3.2/core/units/statistics/statistics_tag_processor.php
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.3
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.3.2/core/admin_templates/groups/groups_edit.tpl
===================================================================
--- branches/unlabeled/unlabeled-1.3.2/core/admin_templates/groups/groups_edit.tpl (nonexistent)
+++ branches/unlabeled/unlabeled-1.3.2/core/admin_templates/groups/groups_edit.tpl (revision 5010)
@@ -0,0 +1,71 @@
+<inp2:m_RequireLogin permissions="in-portal:user_groups.view" system="1"/>
+<inp2:m_include t="incs/header" nobody="yes"/>
+
+<body topmargin="0" leftmargin="8" marginheight="0" marginwidth="8" bgcolor="#FFFFFF">
+<inp2:m_ParseBlock name="section_header" prefix="g" icon="icon46_usergroups" module="in-portal" title="!la_title_Groups!"/>
+
+<inp2:m_include t="groups/groups_edit_tabs"/>
+
+<inp2:m_ParseBlock name="blue_bar" prefix="g" title_preset="groups_edit" module="in-portal" icon="icon46_usergroups"/>
+
+<!-- ToolBar --->
+<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%" border="0">
+<tbody>
+ <tr>
+ <td>
+ <script type="text/javascript">
+ a_toolbar = new ToolBar();
+ a_toolbar.AddButton( new ToolBarButton('select', '<inp2:m_phrase label="la_ToolTip_Save" escape="1"/>', function() {
+ submit_event('g','<inp2:g_SaveEvent/>');
+ }
+ ) );
+ a_toolbar.AddButton( new ToolBarButton('cancel', '<inp2:m_phrase label="la_ToolTip_Cancel" escape="1"/>', function() {
+ submit_event('g','OnCancelEdit');
+ }
+ ) );
+
+ a_toolbar.AddButton( new ToolBarSeparator('sep1') );
+
+ a_toolbar.AddButton( new ToolBarButton('prev', '<inp2:m_phrase label="la_ToolTip_Prev" escape="1"/>', function() {
+ go_to_id('g', '<inp2:g_PrevId/>');
+ }
+ ) );
+ a_toolbar.AddButton( new ToolBarButton('next', '<inp2:m_phrase label="la_ToolTip_Next" escape="1"/>', function() {
+ go_to_id('g', '<inp2:g_NextId/>');
+ }
+ ) );
+
+ a_toolbar.Render();
+
+ <inp2:m_if prefix="g" function="IsSingle"/>
+ a_toolbar.HideButton('prev');
+ a_toolbar.HideButton('next');
+ a_toolbar.HideButton('sep1');
+ <inp2:m_else/>
+ <inp2:m_if prefix="g" function="IsLast"/>
+ a_toolbar.DisableButton('next');
+ <inp2:m_endif/>
+ <inp2:m_if prefix="g" function="IsFirst"/>
+ a_toolbar.DisableButton('prev');
+ <inp2:m_endif/>
+ <inp2:m_endif/>
+ </script>
+ </td>
+ </tr>
+</tbody>
+</table>
+
+<inp2:g_SaveWarning name="grid_save_warning"/>
+<table width="100%" border="0" cellspacing="0" cellpadding="4" class="tableborder">
+ <inp2:m_ParseBlock name="subsection" title="!la_section_General!"/>
+ <inp2:m_ParseBlock name="inp_id_label" prefix="g" field="GroupId" title="!la_fld_GroupId!"/>
+ <inp2:m_ParseBlock name="inp_edit_box" prefix="g" field="Name" title="!la_fld_GroupName!"/>
+ <inp2:m_ParseBlock name="inp_edit_textarea" prefix="g" field="Description" title="!la_fld_Comments!" rows="5" cols="30"/>
+
+ <inp2:m_if check="m_IsDebugMode">
+ <inp2:m_ParseBlock name="inp_edit_radio" prefix="g" field="Enabled" title="!la_fld_Enabled!" use_phrases="1"/>
+ </inp2:m_if>
+</table>
+
+<inp2:m_include t="incs/footer"/>
+
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.3.2/core/admin_templates/groups/groups_edit.tpl
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.3
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.3.2/core/admin_templates/groups/groups_list.tpl
===================================================================
--- branches/unlabeled/unlabeled-1.3.2/core/admin_templates/groups/groups_list.tpl (nonexistent)
+++ branches/unlabeled/unlabeled-1.3.2/core/admin_templates/groups/groups_list.tpl (revision 5010)
@@ -0,0 +1,61 @@
+<inp2:m_RequireLogin permissions="in-portal:user_groups.view" system="1"/>
+<inp2:m_include t="incs/header" nobody="yes"/>
+
+<body topmargin="0" leftmargin="8" marginheight="0" marginwidth="8" bgcolor="#FFFFFF">
+
+<inp2:m_ParseBlock name="section_header" prefix="g" icon="icon46_usergroups" module="in-portal" title="!la_title_Groups!"/>
+
+<inp2:m_ParseBlock name="blue_bar" prefix="g.total" title_preset="groups_list" module="in-portal" icon="icon46_usergroups"/>
+
+<!-- ToolBar --->
+<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%" border="0">
+<tbody>
+ <tr>
+ <td>
+ <script type="text/javascript">
+ //do not rename - this function is used in default grid for double click!
+ function edit()
+ {
+ set_hidden_field('remove_specials[g.total]', 1);
+ std_edit_item('g.total', 'groups/groups_edit');
+ }
+
+ var a_toolbar = new ToolBar();
+ a_toolbar.AddButton( new ToolBarButton('new_group', '<inp2:m_phrase label="la_ToolTip_New_CustomField" escape="1"/>',
+ function() {
+ set_hidden_field('remove_specials[g.total]', 1);
+ std_precreate_item('g.total', 'groups/groups_edit')
+ } ) );
+
+ 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() {
+ set_hidden_field('remove_specials[g.total]', 1);
+ std_delete_items('g.total');
+ } ) );
+
+ a_toolbar.AddButton( new ToolBarSeparator('sep1') );
+
+ a_toolbar.AddButton( new ToolBarButton('e-mail', '<inp2:m_phrase label="la_ToolTip_SendMail" escape="1"/>', function() {
+ openEmailSend('<inp2:m_t t="sendmail" index_file="email/sendmail.php" pass="m" escape="1"/>', 'group', 'g.total');
+ }
+ ) );
+
+ a_toolbar.AddButton( new ToolBarButton('view', '<inp2:m_phrase label="la_ToolTip_View" escape="1"/>', function() {
+ show_viewmenu(a_toolbar,'view');
+ }
+ ) );
+
+ a_toolbar.Render();
+ </script>
+
+ </td>
+ </tr>
+</tbody>
+</table>
+
+<inp2:m_ParseBlock name="grid" PrefixSpecial="g.total" IdField="GroupId" grid="Default"/>
+<script type="text/javascript">
+ Grids['g.total'].SetDependantToolbarButtons( new Array('edit', 'delete', 'e-mail') );
+</script>
+<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.3.2/core/admin_templates/groups/groups_list.tpl
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.3
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property

Event Timeline