Page Menu
Home
In-Portal Phabricator
Search
Configure Global Search
Log In
Files
F1033910
in-portal
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sat, Jun 21, 4:32 AM
Size
26 KB
Mime Type
text/x-diff
Expires
Mon, Jun 23, 4:32 AM (39 m, 30 s)
Engine
blob
Format
Raw Data
Handle
668182
Attached To
rINP In-Portal
in-portal
View Options
Index: branches/unlabeled/unlabeled-1.6.2/kernel/admin_templates/incs/config_blocks.tpl
===================================================================
--- branches/unlabeled/unlabeled-1.6.2/kernel/admin_templates/incs/config_blocks.tpl (nonexistent)
+++ branches/unlabeled/unlabeled-1.6.2/kernel/admin_templates/incs/config_blocks.tpl (revision 8118)
@@ -0,0 +1,102 @@
+<inp2:m_DefineElement name="config_edit_text">
+ <input type="text" tabindex="<inp2:m_get param="tab_index"/>" name="<inp2:InputName field="$field"/>" value="<inp2:Field field="$field" />" <inp2:m_param name="field_params" />/>
+</inp2:m_DefineElement>
+
+<inp2:m_DefineElement name="config_edit_password">
+ <input type="password" tabindex="<inp2:m_get param="tab_index"/>" primarytype="password" name="<inp2:InputName field="$field"/>" id="<inp2:InputName field="$field"/>" value="" />
+ <input type="password" name="verify_<inp2:InputName field="$field"/>" id="verify_<inp2:InputName field="$field"/>" value="" />
+ <span class="error" id="error_<inp2:InputName field="$field"/>"></span>
+</inp2:m_DefineElement>
+
+<inp2:m_DefineElement name="config_edit_option">
+ <option value="<inp2:m_param name="key"/>"<inp2:m_param name="selected"/>><inp2:m_param name="option"/></option>
+</inp2:m_DefineElement>
+
+<inp2:m_DefineElement name="config_edit_select">
+ <select name="<inp2:InputName field="$field"/>" tabindex="<inp2:m_get param="tab_index"/>">
+ <inp2:PredefinedOptions field="$field" block="config_edit_option" selected="selected"/>
+ </select>
+</inp2:m_DefineElement>
+
+<inp2:m_DefineElement name="config_edit_multiselect">
+ <select id="<inp2:InputName field="$field"/>_select" onchange="update_multiple_options('<inp2:InputName field="$field"/>');" tabindex="<inp2:m_get param="tab_index"/>" multiple>
+ <inp2:PredefinedOptions field="$field" block="config_edit_option" selected="selected"/>
+ </select>
+ <input type="hidden" id="<inp2:InputName field="$field"/>" name="<inp2:InputName field="$field"/>" value="<inp2:Field field="$field"/>"/>
+</inp2:m_DefineElement>
+
+<inp2:m_DefineElement name="config_edit_checkbox" field_class="">
+ <input type="hidden" id="<inp2:InputName field="$field"/>" name="<inp2:InputName field="$field"/>" value="<inp2:Field field="$field" db="db"/>">
+ <input tabindex="<inp2:m_get param="tab_index"/>" type="checkbox" id="_cb_<inp2:m_param name="field"/>" name="_cb_<inp2:InputName field="$field"/>" <inp2:Field field="$field" checked="checked" db="db"/> class="<inp2:m_param name="field_class"/>" onclick="update_checkbox(this, document.getElementById('<inp2:InputName field="$field"/>'))">
+</inp2:m_DefineElement>
+
+<inp2:m_DefineElement name="config_edit_textarea">
+ <textarea tabindex="<inp2:m_get param="tab_index"/>" name="<inp2:InputName field="$field"/>" <inp2:m_param name="field_params" />><inp2:Field field="$field" /></textarea>
+</inp2:m_DefineElement>
+
+<inp2:m_DefineElement name="config_radio_item">
+ <input type="radio" <inp2:m_param name="checked"/> name="<inp2:InputName field="$field"/>" id="<inp2:InputName field="$field"/>_<inp2:m_param name="key"/>" value="<inp2:m_param name="key"/>"><label for="<inp2:InputName field="$field"/>_<inp2:m_param name="key"/>"><inp2:m_param name="option"/></label>
+</inp2:m_DefineElement>
+
+<inp2:m_DefineElement name="config_edit_radio">
+ <inp2:PredefinedOptions field="$field" block="config_radio_item" selected="checked"/>
+</inp2:m_DefineElement>
+
+<inp2:m_DefineElement name="config_block">
+ <inp2:m_inc param="tab_index" by="1"/>
+ <inp2:m_if check="m_ParamEquals" name="show_heading" value="1">
+ <tr class="subsectiontitle">
+ <td colspan="2">
+ <inp2:Field name="heading" as_label="1"/>
+ </td>
+ <td align="right">
+ <a class="config-header" href="javascript:toggle_section('<inp2:Field name="heading"/>');" id="toggle_mark[<inp2:Field name="heading"/>]" title="Collapse/Expand Section">[-]</a>
+ </td>
+ </tr>
+ </inp2:m_if>
+ <tr class="<inp2:m_odd_even odd="table_color1" even="table_color2"/>" id="<inp2:m_param name="PrefixSpecial"/>_<inp2:field field="$IdField"/>" header_label="<inp2:Field name="heading"/>">
+ <td>
+ <inp2:Field field="prompt" as_label="1" />
+ <inp2:m_if check="m_IsDebugMode">
+ <br><small>[<inp2:Field field="DisplayOrder"/>] <inp2:Field field="VariableName"/></small>
+ </inp2:m_if>
+ </td>
+
+ <td>
+ <inp2:ConfigFormElement PrefixSpecial="$PrefixSpecial" field="VariableValue" blocks_prefix="config_edit_" element_type_field="element_type" value_list_field="ValueList"/>
+ </td>
+
+ <td class="error"><inp2:Error id_field="VariableName"/> </td>
+ </tr>
+</inp2:m_DefineElement>
+
+<inp2:m_DefineElement name="config_block1">
+ <inp2:m_inc param="tab_index" by="1"/>
+ <inp2:m_if check="m_ParamEquals" name="show_heading" value="1">
+ <tr class="subsectiontitle">
+ <td colspan="2">
+ <inp2:Field name="heading" as_label="1"/>
+ </td>
+ <td align="right">
+ <a class="config-header" href="javascript:toggle_section('<inp2:Field name="heading"/>');" id="toggle_mark[<inp2:Field name="heading"/>]" title="Collapse/Expand Section">[-]</a>
+ </td>
+ </tr>
+ </inp2:m_if>
+ <tr class="<inp2:m_odd_even odd="table_color1" even="table_color2"/>" id="<inp2:m_param name="PrefixSpecial"/>_<inp2:Field field="$IdField"/>" header_label="<inp2:Field name="heading"/>">
+ <td>
+ <inp2:Field field="prompt" as_label="1" />
+ <inp2:m_if check="m_IsDebugMode">
+ <br><small>[<inp2:Field field="DisplayOrder"/>] <inp2:Field field="VariableName"/></small>
+ </inp2:m_if>
+ </td>
+
+ <td>
+ <nobr><inp2:ConfigFormElement PrefixSpecial="$PrefixSpecial" field="VariableValue" blocks_prefix="config_edit_" element_type_field="element_type" value_list_field="ValueList"/>
+</inp2:m_DefineElement>
+
+<inp2:m_DefineElement name="config_block2">
+ <inp2:ConfigFormElement PrefixSpecial="$PrefixSpecial" field="VariableValue" blocks_prefix="config_edit_" element_type_field="element_type" value_list_field="ValueList"/></nobr>
+ </td>
+ <td class="error"><inp2:Error id_field="VariableName"/> </td>
+ </tr>
+</inp2:m_DefineElement>
Property changes on: branches/unlabeled/unlabeled-1.6.2/kernel/admin_templates/incs/config_blocks.tpl
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.6
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.6.2/core/admin_templates/tools/system_tools.tpl
===================================================================
--- branches/unlabeled/unlabeled-1.6.2/core/admin_templates/tools/system_tools.tpl (nonexistent)
+++ branches/unlabeled/unlabeled-1.6.2/core/admin_templates/tools/system_tools.tpl (revision 8118)
@@ -0,0 +1,51 @@
+<inp2:m_RequireLogin permissions="in-portal:service.view" system="1"/>
+<inp2:m_include t="incs/header"/>
+<inp2:m_ParseBlock name="section_header" icon="icon46_modules" title="!la_title_SystemTools!"/>
+
+<inp2:m_ParseBlock name="blue_bar" prefix="adm" title_preset="system_tools" module="in-portal" icon="icon46_modules"/>
+
+<script type="text/javascript">
+ function show_structure($prefix, $event) {
+ var $form = document.getElementById($form_name);
+ openwin('about:blank', 'table_structure', 800, 575);
+ $form.target = 'table_structure';
+ submit_event($prefix, $event);
+ set_hidden_field('events[adm]', '');
+ }
+</script>
+
+<inp2:m_DefineElement name="service_elem">
+ <tr class="<inp2:m_odd_even odd="table_color1" even="table_color2"/>">
+ <inp2:m_inc param="tab_index" by="1"/>
+ <td class="text" style="width: 300px;">
+ <inp2:m_phrase label="$title"/>:
+ </td>
+ <td valign="top" colspan="2">
+ <input class="button" type="button" onclick="submit_event('adm', '<inp2:m_param name="event_name"/>');" value="Go">
+ </td>
+ <td class="error"> </td>
+ </tr>
+</inp2:m_DefineElement>
+
+<table width="100%" border="0" cellspacing="0" cellpadding="4" class="tableborder" id="config_table">
+ <inp2:m_RenderElement name="subsection" title="la_section_General"/>
+ <inp2:m_RenderElement name="service_elem" title="la_Service_ResetModRwCache" event_name="OnResetModRwCache"/>
+ <inp2:m_RenderElement name="service_elem" title="la_Service_ResetCMSMenuCache" event_name="OnResetCMSMenuCache"/>
+ <inp2:m_RenderElement name="service_elem" title="la_Service_ResetSections" event_name="OnResetSections"/>
+ <inp2:m_RenderElement name="service_elem" title="la_Service_ConfigCache" event_name="OnResetConfigsCache"/>
+ <inp2:m_RenderElement name="service_elem" title="la_Service_RebuildThemes" event_name="OnRebuildThemes"/>
+ <inp2:m_RenderElement name="subsection" title="la_section_Configs"/>
+ <tr class="<inp2:m_odd_even odd="table_color1" even="table_color2"/>">
+ <inp2:m_inc param="tab_index" by="1"/>
+ <td class="text" style="width: 300px;">
+ Table Structure:
+ </td>
+ <td valign="top" colspan="2">
+ <input type="text" name="table_name" value="" size="30"/>
+ <input class="button" type="button" onclick="show_structure('adm', 'OnGenerateTableStructure');" value="Go">
+ <span class="small">table name (prefix optional) OR unit config prefix</span>
+ </td>
+ </tr>
+</table>
+
+<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.6.2/core/admin_templates/tools/system_tools.tpl
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.6
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.6.2/core/admin_templates/js/grid.js
===================================================================
--- branches/unlabeled/unlabeled-1.6.2/core/admin_templates/js/grid.js (nonexistent)
+++ branches/unlabeled/unlabeled-1.6.2/core/admin_templates/js/grid.js (revision 8118)
@@ -0,0 +1,499 @@
+var $GridManager = new GridManager();
+
+function GridManager () {
+ this.Grids = Grids; // get all from global variable, in future replace all references to it with $GridManager.Grids
+ this.AlternativeGrids = new Array();
+}
+
+GridManager.prototype.AddAlternativeGrid = function ($source_grid, $destination_grid, $reciprocal)
+{
+ if ($source_grid == $destination_grid) {
+ return false;
+ }
+
+ if (typeof(this.AlternativeGrids[$source_grid]) == 'undefined') {
+ // alternative grids not found, create empty list
+ this.AlternativeGrids[$source_grid] = new Array();
+ }
+
+ if (!in_array($destination_grid, this.AlternativeGrids[$source_grid])) {
+ // alternative grids found, check if not added already
+ this.AlternativeGrids[$source_grid].push($destination_grid);
+ }
+
+ if ($reciprocal) {
+ this.AddAlternativeGrid($destination_grid, $source_grid);
+ }
+}
+
+GridManager.prototype.ClearAlternativeGridsSelection = function ($source_prefix)
+{
+ if (!this.AlternativeGrids[$source_prefix]) return false;
+
+ var $i = 0;
+ var $destination_prefix = '';
+ while ($i < this.AlternativeGrids[$source_prefix].length) {
+ $destination_prefix = this.AlternativeGrids[$source_prefix][$i];
+ if (this.Grids[$destination_prefix]) {
+ // alternative grid set, but not yet loaded by ajax
+ this.Grids[$destination_prefix].ClearSelection();
+ }
+ $i++;
+ }
+}
+
+GridManager.prototype.CheckDependencies = function ($prefix) {
+ if (typeof(this.Grids[$prefix]) != 'undefined') {
+ this.Grids[$prefix].CheckDependencies('GridManager.CheckDependencies');
+ }
+}
+
+function GridItem(grid, an_element, cb, item_id, class_on, class_off)
+{
+ this.Grid = grid;
+ this.selected = false;
+ this.id = an_element.id;
+ this.ItemId = item_id;
+ this.sequence = parseInt(an_element.getAttribute('sequence'));
+// this.class_on = class_on;
+
+ if (class_off == ':original') {
+ this.class_off = an_element.className;
+ }
+ else
+ this.class_off = class_off;
+
+ if (class_on.match(/(.*):(.*)/)) {
+ var even = RegExp.$2;
+ var odd = RegExp.$1;
+ this.class_on = this.class_off.match(/even/) ? even : odd
+ }
+ else {
+ this.class_on = class_on
+ }
+
+ this.HTMLelement = an_element;
+
+ if (document.getElementById('left_'+an_element.id)) {
+ this.LeftElement = document.getElementById('left_'+an_element.id);
+ }
+ else {
+ this.LeftElement = false;
+ }
+
+ this.CheckBox = cb;
+
+ this.value = this.ItemId;
+ this.ItemType = 11;
+}
+
+GridItem.prototype.Init = function ()
+{
+ this.HTMLelement.GridItem = this;
+ this.HTMLelement.onclick = function(ev) {
+ this.GridItem.Click(ev);
+ };
+ this.HTMLelement.ondblclick = function(ev) {
+ this.GridItem.DblClick(ev);
+ }
+ if ( this.LeftElement ) {
+ this.LeftElement.GridItem = this;
+ this.LeftElement.onclick = function(ev) {
+ this.GridItem.Click(ev);
+ };
+ this.LeftElement.ondblclick = function(ev) {
+ this.GridItem.DblClick(ev);
+ }
+ }
+ if ( isset(this.CheckBox) ) {
+ this.CheckBox.GridItem = this;
+ this.CheckBox.onclick = function(ev) {
+ this.GridItem.cbClick(ev);
+ };
+ this.CheckBox.ondblclick = function(ev) {
+ this.GridItem.DblClick(ev);
+ }
+ }
+
+ if ( this.Grid.MouseOverClass ) {
+ addEvent(this.HTMLelement, 'mouseover', function(ev) { this.GridItem.MouseOver(ev)}, true); // true for traditional event model
+ addEvent(this.HTMLelement, 'mouseout', function(ev) { this.GridItem.MouseOut(ev)}, true);
+ if ( this.LeftElement ) {
+ addEvent(this.LeftElement, 'mouseover', function(ev) { this.GridItem.MouseOver(ev)}, true);
+ addEvent(this.LeftElement, 'mouseout', function(ev) { this.GridItem.MouseOut(ev)}, true);
+ }
+ }
+
+}
+
+GridItem.prototype.DisableClicking = function ()
+{
+ this.HTMLelement.onclick = function(ev) {
+ return false;
+ };
+ this.HTMLelement.ondblclick = function(ev) {
+ return false;
+ }
+ if ( this.LeftElement ) {
+ this.LeftElement.onclick = function(ev) {
+ return false;
+ };
+ this.LeftElement.ondblclick = function(ev) {
+ return false;
+ }
+ }
+ if ( isset(this.CheckBox) ) {
+ this.CheckBox.onclick = function(ev) {
+ return false;
+ };
+ }
+}
+
+GridItem.prototype.Select = function ()
+{
+ if (this.selected) return;
+ this.selected = true;
+ this.HTMLelement.className = this.class_on;
+ if ( this.LeftElement ) {
+ this.LeftElement.className = this.class_on;
+ }
+ if ( isset(this.CheckBox) ) {
+ this.CheckBox.checked = true;
+ }
+ this.Grid.LastSelectedId = this.ItemId;
+ this.Grid.SelectedCount++;
+
+ // this is for in-portal only (used in relation select)
+ LastCheckedItem = this;
+ if (typeof (this.Grid.OnSelect) == 'function' ) {
+ this.Grid.OnSelect(this.ItemId);
+ }
+}
+
+GridItem.prototype.UnSelect = function ( force )
+{
+ if ( !this.selected && !force) return;
+ this.selected = false;
+ this.HTMLelement.className = this.class_off;
+ if ( this.LeftElement ) {
+ this.LeftElement.className = this.class_off;
+ }
+ if ( isset(this.CheckBox) ) {
+ this.CheckBox.checked = false;
+ }
+ this.Grid.SelectedCount--;
+ if (typeof (this.Grid.OnUnSelect) == 'function' ) {
+ this.Grid.OnUnSelect(this.ItemId);
+ }
+ this.Grid.LastSelectedId = null;
+}
+
+GridItem.prototype.ClearBrowserSelection = function() {
+ ClearBrowserSelection();
+}
+
+GridItem.prototype.Click = function (ev)
+{
+ //this.ClearBrowserSelection();
+ this.Grid.ClearAlternativeGridsSelection('GridItem.Click');
+
+ var e = !is.ie ? ev : window.event;
+
+ if (e.shiftKey && !this.Grid.RadioMode) {
+ this.ClearBrowserSelection();
+ this.Grid.SelectRangeUpTo(this.sequence);
+ }
+ else {
+ if (e.ctrlKey && !this.Grid.RadioMode) {
+ this.Toggle()
+ }
+ else {
+ if (!(this.Grid.RadioMode && this.Grid.LastSelectedId == this.ItemId && this.selected)) {
+ // don't clear selection if item same as current is selected
+ if (!this.Grid.StickySelection) {
+ this.Grid.ClearSelection(null,'GridItem.Click');
+ }
+ else {
+ if (this.Grid.LastSelectedId == this.ItemId) {
+ return;
+ }
+ }
+ this.Toggle();
+ }
+ }
+ }
+ this.Grid.CheckDependencies('GridItem.Click');
+ e.cancelBubble = true;
+}
+
+GridItem.prototype.cbClick = function (ev)
+{
+ var e = is.ie ? window.event : ev;
+ if (this.Grid.RadioMode) this.Grid.ClearSelection(null,'GridItem.cbClick');
+ this.Grid.ClearAlternativeGridsSelection('GridItem.cbClick');
+ this.Toggle();
+ this.Grid.CheckDependencies('GridItem.cbClick');
+ e.cancelBubble = true;
+}
+
+GridItem.prototype.DblClick = function (ev)
+{
+ var e = is.ie ? window.event : ev;
+ this.Grid.Edit();
+}
+
+GridItem.prototype.MouseOver = function (ev)
+{
+ this.HTMLelement.className = this.Grid.MouseOverClass;
+ if ( this.LeftElement ) {
+ this.LeftElement.className = this.Grid.MouseOverClass;
+ }
+}
+GridItem.prototype.MouseOut = function (ev)
+{
+ this.HTMLelement.className = this.selected ? this.class_on : this.class_off;
+ if ( this.LeftElement ) {
+ this.LeftElement.className = this.selected ? this.class_on : this.class_off;
+ }
+}
+
+GridItem.prototype.Toggle = function ()
+{
+ if (this.selected) this.UnSelect()
+ else {
+ this.Grid.LastSelectedSequence = this.sequence;
+ this.Select();
+ }
+}
+
+GridItem.prototype.FallsInRange = function (from, to)
+{
+ return (from <= to) ?
+ (this.sequence >= from && this.sequence <= to) :
+ (this.sequence >= to && this.sequence <= from);
+}
+
+
+function Grid(prefix, class_on, class_off, dbl_click, toolbar)
+{
+ this.prefix = prefix;
+ this.class_on = class_on;
+ this.class_off = class_off;
+ this.Items = new Array();
+ this.LastSelectedSequence = 1;
+ this.LastSelectedId = null;
+ this.DblClick = dbl_click;
+ this.ToolBar = toolbar;
+ this.SelectedCount = 0;
+ this.AlternativeGrids = new Array();
+ this.DependantButtons = new Array();
+ this.RadioMode = false;
+ this.MouseOverClass = false;
+
+ // K3-style sticky selection, selection an item does not unselect currently selected
+ // even w/o Ctrl key pressed
+ this.StickySelection = false;
+}
+
+Grid.prototype.AddItem = function( an_item ) {
+ this.Items[an_item.id] = an_item;
+}
+
+Grid.prototype.AddItemsByIdMask = function ( tag, mask, cb_mask ) {
+ var $item_id=0;
+ elements = document.getElementsByTagName(tag.toUpperCase());
+ for (var i=0; i < elements.length; i++) {
+ if ( typeof(elements[i].id) == 'undefined') {
+ continue;
+ }
+ if ( !elements[i].id.match(mask)) continue;
+ $item_id=RegExp.$1;
+
+ cb_name = cb_mask.replace('$$ID$$',$item_id);
+
+ cb = document.getElementById(cb_name);
+ if (typeof(cb) == 'undefined') alert ('No Checkbox defined for item '+elements[i].id);
+
+ this.AddItem( new GridItem( this, elements[i], cb, $item_id, this.class_on, this.class_off ) );
+ }
+}
+
+Grid.prototype.InitItems = function() {
+ for (var i in this.Items) {
+ this.Items[i].Init();
+ }
+ this.ClearSelection( true,'Grid.InitItems' );
+
+ var a_Grid = this;
+ addEvent(document, 'keyup', function(ev) {
+ var e = !is.ie ? ev : window.event;
+ switch (e.keyCode) {
+ case 65:
+ if (!e.ctrlKey) break;
+ a_Grid.SelectAll();
+ ClearBrowserSelection()
+// window.setTimeout(ClearBrowserSelection, 500);
+ break;
+ case 27:
+ a_Grid.ClearSelection();
+ break;
+ case 33:
+ case 37:
+ //alert('<-') // go to prev page here
+ break;
+ case 34:
+ case 39:
+ // alert('->') // go to next page here
+ break;
+ case 88:
+ ClearBrowserSelection();
+ break;
+ }
+ });
+}
+
+Grid.prototype.DisableClicking = function() {
+ for (var i in this.Items) {
+ this.Items[i].DisableClicking();
+ }
+ this.ClearSelection( true, 'Grid.DisableClicking' );
+}
+
+Grid.prototype.ClearSelection = function( force, called_from ) {
+// alert('selection clear. force: '+force+'; called_from: '+called_from);
+ if (typeof(force) == 'undefined') force = false;
+ if (this.CountSelected() == 0 && !force) return;
+ for (var i in this.Items) {
+ this.Items[i].UnSelect(force);
+ }
+ this.SelectedCount = 0;
+ this.CheckDependencies('Grid.ClearSelection');
+}
+
+Grid.prototype.GetSelected = function() {
+ var $ret = new Array();
+ for (var i in this.Items) {
+ if (this.Items[i].selected) {
+ $ret[$ret.length] = this.Items[i].ItemId;
+ }
+
+ }
+ return $ret;
+}
+
+Grid.prototype.SetSelected = function($ids) {
+ $ids = $ids.split(',');
+ for (var i in this.Items) {
+ if (in_array(this.Items[i].ItemId, $ids)) {
+ this.Items[i].Select();
+ }
+ }
+}
+
+Grid.prototype.InvertSelection = function() {
+ for (var i in this.Items)
+ {
+ if( this.Items[i].selected )
+ {
+ this.Items[i].UnSelect();
+ }
+ else
+ {
+ this.Items[i].Select();
+ }
+ }
+ this.CheckDependencies('Grid.InvertSelection');
+}
+
+Grid.prototype.SelectAll = function() {
+ for (var i in this.Items) {
+ this.Items[i].Select();
+ }
+ this.CheckDependencies('Grid.SelectAll');
+ this.ClearAlternativeGridsSelection('Grid.SelectAll');
+}
+
+Grid.prototype.SelectRangeUpTo = function( last_sequence ) {
+ for (var i in this.Items) {
+ if (this.Items[i].FallsInRange(this.LastSelectedSequence, last_sequence)) {
+ this.Items[i].Select();
+ }
+ }
+}
+
+Grid.prototype.CountSelected = function ()
+{
+ return this.SelectedCount;
+}
+
+Grid.prototype.Edit = function() {
+ if ( this.CountSelected() == 0 ) return;
+ this.DblClick(this.prefix);
+}
+
+Grid.prototype.SetDependantToolbarButtons = function($buttons, $direct, $mode) {
+ if (!isset($direct)) $direct = true; // direct (use false for invert mode)
+ if (!isset($mode)) $mode = 1; // enable/disable (use 2 for show/hide mode)
+ for (var i in $buttons) {
+ this.DependantButtons.push(new Array($buttons[i], $direct, $mode));
+ }
+ //this.DependantButtons = buttons;
+ this.CheckDependencies('Grid.SetDependantToolbarButtons');
+}
+
+Grid.prototype.CheckDependencies = function($called_from)
+{
+// alert('prefix: ' + this.prefix + '; ' + $called_from + ' -> Grid.CheckDependencies');
+ var enabling = (this.CountSelected() > 0);
+ for (var i in this.DependantButtons) {
+ if (this.DependantButtons[i][0].match("portal:(.*)")) {
+ button_name = RegExp.$1;
+ if (toolbar) {
+ if (enabling == this.DependantButtons[i][1]) {
+ toolbar.enableButton(button_name, true);
+ }
+ else
+ {
+ toolbar.disableButton(button_name, true);
+ }
+ }
+ }
+ else {
+ if (this.DependantButtons[i][2] == 1) {
+ this.ToolBar.SetEnabled(this.DependantButtons[i][0], enabling == this.DependantButtons[i][1]);
+ }
+ else {
+ this.ToolBar.SetVisible(this.DependantButtons[i][0], enabling == this.DependantButtons[i][1]);
+ }
+ }
+ }
+ //if (enabling) this.ClearAlternativeGridsSelection('Grid.CheckDependencies');
+
+}
+
+Grid.prototype.ClearAlternativeGridsSelection = function (called_from)
+{
+ $GridManager.ClearAlternativeGridsSelection(this.prefix);
+}
+
+Grid.prototype.AddAlternativeGrid = function (alt_grid, reciprocal)
+{
+ var $dst_prefix = typeof('alt_grid') == 'string' ? alt_grid : alt_grid.prefix;
+ $GridManager.AddAlternativeGrid(this.prefix, $dst_prefix, reciprocal);
+}
+
+Grid.prototype.FirstSelected = function ()
+{
+ min_sequence = null;
+ var res = null
+ for (var i in this.Items) {
+ if (!this.Items[i].selected) continue;
+ if (min_sequence == null)
+ min_sequence = this.Items[i].sequence;
+ if (this.Items[i].sequence <= min_sequence) {
+ res = this.Items[i].ItemId;
+ min_sequence = this.Items[i].sequence;
+ }
+ }
+ return res;
+}
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.6.2/core/admin_templates/js/grid.js
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.6
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.6.2/core/install/upgrades.php
===================================================================
--- branches/unlabeled/unlabeled-1.6.2/core/install/upgrades.php (nonexistent)
+++ branches/unlabeled/unlabeled-1.6.2/core/install/upgrades.php (revision 8118)
@@ -0,0 +1,93 @@
+<?php
+ $upgrade_class = 'CoreUpgrades';
+
+ /**
+ * Class, that holds all upgrade scripts for "Core" module
+ *
+ */
+ class CoreUpgrades extends kHelper {
+
+ /**
+ * Installator instance
+ *
+ * @var kInstallator
+ */
+ var $Installator = null;
+
+ function setInstallator(&$instance)
+ {
+ $this->Installator =& $instance;
+ }
+
+ /**
+ * Changes table structure, where multilingual fields of TEXT type are present
+ *
+ * @param string $mode when called mode {before, after)
+ */
+ function Upgrade_4_0_2($mode)
+ {
+ if ($mode == 'before') {
+ // don't user after, because In-Portal calls this method too
+ $this->Installator->SaveConfig();
+ }
+
+ if ($mode == 'after') {
+ $ml_helper =& $this->Application->recallObject('kMultiLanguageHelper');
+ /* @var $ml_helper kMultiLanguageHelper */
+
+ $lang_count = $ml_helper->getLanguageCount();
+ $this->Application->UnitConfigReader->iterateConfigs(Array (&$this, 'updateTextFields'), $lang_count);
+ }
+ }
+
+ /**
+ * Callback function, that makes all ml fields of text type null with same default value
+ *
+ * @param string $prefix
+ * @param Array $config_data
+ * @param int $language_count
+ * @return bool
+ */
+ function updateTextFields($prefix, &$config_data, $language_count)
+ {
+ if (!isset($config_data['TableName']) || !isset($config_data['Fields'])) {
+ // invalid config found or prefix not found
+ return false;
+ }
+
+ $table_name = $config_data['TableName'];
+ $table_structure = $this->Conn->Query('DESCRIBE '.$table_name, 'Field');
+ if (!$table_structure) {
+ // table not found
+ return false;
+ }
+
+ $sqls = Array ();
+ foreach ($config_data['Fields'] as $field => $options) {
+ if (isset($options['formatter']) && $options['formatter'] == 'kMultiLanguage' && !isset($options['master_field'])) {
+ // update all l<lang_id>_<field_name> fields (new format)
+ for ($i = 1; $i <= $language_count; $i++) {
+ $ml_field = 'l'.$i.'_'.$field;
+ if ($table_structure[$ml_field]['Type'] == 'text') {
+ $sqls[] = 'CHANGE '.$ml_field.' '.$ml_field.' TEXT NULL DEFAULT NULL';
+ }
+ }
+
+ // update <field_name> if found (old format)
+ if (isset($table_structure[$field]) && $table_structure[$field]['Type'] == 'text') {
+ $sqls[] = 'CHANGE '.$field.' '.$field.' TEXT NULL DEFAULT NULL';
+ }
+ }
+ }
+
+ if ($sqls) {
+ $sql = 'ALTER TABLE '.$table_name.' '.implode(', ', $sqls);
+ $this->Conn->Query($sql);
+ }
+
+ return true;
+ }
+
+ }
+
+?>
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.6.2/core/install/upgrades.php
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.6
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Event Timeline
Log In to Comment