Page Menu
Home
In-Portal Phabricator
Search
Configure Global Search
Log In
Files
F1215674
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
Wed, Nov 12, 3:11 AM
Size
36 KB
Mime Type
text/x-diff
Expires
Fri, Nov 14, 3:11 AM (4 h, 23 m)
Engine
blob
Format
Raw Data
Handle
794393
Attached To
rINP In-Portal
in-portal
View Options
Index: branches/unlabeled/unlabeled-1.8.2/kernel/admin_templates/regional/phrases_edit.tpl
===================================================================
--- branches/unlabeled/unlabeled-1.8.2/kernel/admin_templates/regional/phrases_edit.tpl (nonexistent)
+++ branches/unlabeled/unlabeled-1.8.2/kernel/admin_templates/regional/phrases_edit.tpl (revision 6146)
@@ -0,0 +1,57 @@
+<inp2:m_RequireLogin permissions="in-portal:configure_lang.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" icon="icon46_conf_regional" title="!la_title_RegionalSettings!"/>
+
+<inp2:m_ParseBlock name="blue_bar" prefix="phrases" title_preset="phrase_edit" module="in-portal" icon="icon46_conf_regional"/>
+
+<!-- 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('phrases','<inp2:phrases_SaveEvent/>');
+ }
+ ) );
+ a_toolbar.AddButton( new ToolBarButton('cancel', '<inp2:m_phrase label="la_ToolTip_Cancel" escape="1"/>', function() {
+ submit_event('phrases','OnCancel');
+ }
+ ) );
+
+ a_toolbar.Render();
+ </script>
+ </td>
+ </tr>
+</tbody>
+</table>
+
+<inp2:phrases_SaveWarning name="grid_save_warning"/>
+<table width="100%" border="0" cellspacing="0" cellpadding="4" class="tableborder">
+ <input type="hidden" id="phrases_label" name="phrases_label" value="<inp2:m_get name="phrases_label"/>">
+ <inp2:m_DefineElement name="phrase_element">
+ <tr class="subsectiontitle">
+ <td colspan="3"><inp2:phrases_Field name="Phrase"/></td>
+ </tr>
+
+ <inp2:m_ParseBlock name="inp_edit_hidden" prefix="phrases" field="LanguageId"/>
+ <inp2:m_ParseBlock name="inp_label" prefix="phrases" field="PrimaryTranslation" title="!la_fld_PrimaryTranslation!"/>
+ <inp2:m_ParseBlock name="inp_edit_box" prefix="phrases" field="Phrase" title="!la_fld_Phrase!" size="60"/>
+ <inp2:m_ParseBlock name="inp_edit_textarea" prefix="phrases" field="Translation" title="!la_fld_Translation!" rows="7" cols="90" allow_html="0"/>
+
+ <inp2:m_ParseBlock name="inp_edit_radio" prefix="phrases" field="PhraseType" title="!la_fld_PhraseType!"/>
+ <inp2:m_ParseBlock name="inp_edit_options" prefix="phrases" field="Module" title="!la_fld_Module!"/>
+ </inp2:m_DefineElement>
+
+ <inp2:m_if check="m_GetEquals" name="phrases_label" value="">
+ <inp2:phrases_MultipleEditing render_as="phrase_element"/>
+ <inp2:m_else/>
+ <inp2:m_RenderElement name="phrase_element"/>
+ </inp2:m_if>
+</table>
+
+<inp2:m_include t="incs/footer"/>
+
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.8.2/kernel/admin_templates/regional/phrases_edit.tpl
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.8
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.8.2/kernel/admin_templates/incs/custom_blocks.tpl
===================================================================
--- branches/unlabeled/unlabeled-1.8.2/kernel/admin_templates/incs/custom_blocks.tpl (nonexistent)
+++ branches/unlabeled/unlabeled-1.8.2/kernel/admin_templates/incs/custom_blocks.tpl (revision 6146)
@@ -0,0 +1,104 @@
+<inp2:m_DefineElement name="config_edit_text">
+ <input type="text" name="<inp2:CustomInputName/>" value="<inp2:Field field="$field"/>" />
+</inp2:m_DefineElement>
+
+<inp2:m_DefineElement name="config_edit_password">
+ <input type="password" primarytype="password" name="<inp2:CustomInputName/>" id="<inp2:CustomInputName/>" value="" />
+ <input type="password" name="verify_<inp2:CustomInputName/>" id="verify_<inp2:CustomInputName/>" value="" />
+ <span class="error" id="error_<inp2:CustomInputName/>"></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:CustomInputName/>">
+ <inp2:PredefinedOptions field="$field" block="config_edit_option" selected="selected"/>
+ </select>
+</inp2:m_DefineElement>
+
+<inp2:m_DefineElement name="config_edit_checkbox">
+ <input type="hidden" id="<inp2:CustomInputName/>" name="<inp2:CustomInputName/>" 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:m_param name="field"/>" <inp2:Field field="$field" checked="checked" db="db"/> onclick="update_checkbox(this, document.getElementById('<inp2:CustomInputName/>'))">
+</inp2:m_DefineElement>
+
+<inp2:m_DefineElement name="config_edit_textarea">
+ <textarea name="<inp2:CustomInputName/>" <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:CustomInputName/>" id="<inp2:CustomInputName/>_<inp2:m_param name="key"/>" value="<inp2:m_param name="key"/>"><label for="<inp2:CustomInputName/>_<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_edit_date">
+ <inp2:m_if check="m_GetEquals" name="calendar_included" value="1" inverse="inverse">
+ <script type="text/javascript" src="incs/calendar.js"></script>
+ <inp2:m_set calendar_included="1"/>
+ </inp2:m_if>
+
+ <input type="text" name="<inp2:CustomInputName append="_date"/>" id="<inp2:CustomInputName append="_date"/>" value="<inp2:CustomField append="_date" format="_regional_InputDateFormat"/>" size="<inp2:CustomFormat append="_date" input_format="1" edit_size="edit_size"/>" datepickerIcon="<inp2:m_ProjectBase/>admin/images/ddarrow.gif"> <span class="small">(<inp2:CustomFormat append="_date" input_format="1" human="true"/>)</span>
+ <script type="text/javascript">
+ initCalendar("<inp2:CustomInputName append="_date"/>", "<inp2:CustomFormat append="_date" input_format="1"/>");
+ </script>
+ <input type="hidden" name="<inp2:CustomInputName append="_time"/>" value="">
+</inp2:m_DefineElement>
+
+<inp2:m_DefineElement name="config_edit_datetime">
+ <inp2:m_if check="m_GetEquals" name="calendar_included" value="1" inverse="inverse">
+ <script type="text/javascript" src="incs/calendar.js"></script>
+ <inp2:m_set calendar_included="1"/>
+ </inp2:m_if>
+
+ <input type="text" name="<inp2:CustomInputName append="_date"/>" id="<inp2:CustomInputName append="_date"/>" value="<inp2:CustomField append="_date" format="_regional_InputDateFormat"/>" size="<inp2:CustomFormat append="_date" input_format="1" edit_size="edit_size"/>" datepickerIcon="<inp2:m_ProjectBase/>admin/images/ddarrow.gif"> <span class="small">(<inp2:CustomFormat append="_date" input_format="1" human="true"/>)</span>
+ <script type="text/javascript">
+ initCalendar("<inp2:CustomInputName append="_date"/>", "<inp2:CustomFormat append="_date" input_format="1"/>");
+ </script>
+ <input type="text" name="<inp2:CustomInputName append="_time"/>" id="<inp2:CustomInputName append="_time"/>" value="<inp2:CustomField append="_time" format="_regional_InputTimeFormat"/>" size="<inp2:CustomFormat append="_time" input_format="1" edit_size="edit_size"/>"><span class="small"> (<inp2:CustomFormat append="_time" input_format="1" human="true"/>)</span>
+</inp2:m_DefineElement>
+
+<inp2:m_DefineElement name="cv_row_block">
+ <inp2:m_if check="m_ParamEquals" name="show_heading" value="1">
+ <tr class="subsectiontitle">
+ <td colspan="3">
+ <inp2:Field name="Heading" as_label="1"/>
+ </td>
+ <inp2:m_if check="{$SourcePrefix}_DisplayOriginal" pass_params="1">
+ <td><inp2:m_phrase name="$original_title"/></td>
+ </inp2:m_if>
+ </tr>
+ </inp2:m_if>
+ <tr class="<inp2:m_odd_even odd="table_color1" even="table_color2"/>" >
+ <inp2:m_ParseBlock name="grid_data_label_ml_td" grid="$grid" SourcePrefix="$SourcePrefix" value_field="$value_field" ElementTypeField="ElementType" field="Prompt" PrefixSpecial="$PrefixSpecial"/>
+ <td valign="top" class="text">
+ <inp2:ConfigFormElement field="Value" blocks_prefix="config_edit_" element_type_field="ElementType" value_list_field="ValueList" />
+ </td>
+ <td class="error"><inp2:CustomError/> </td>
+ <inp2:m_if check="{$SourcePrefix}_DisplayOriginal" pass_params="1">
+ <inp2:m_RenderElement prefix="$SourcePrefix" field="$field" name="inp_original_label"/>
+ </inp2:m_if>
+ </tr>
+</inp2:m_DefineElement>
+
+<inp2:m_DefineElement name="edit_custom_td">
+ <td valign="top" class="text">
+ <inp2:ConfigFormElement field="Value" blocks_prefix="config_edit_" element_type_field="ElementType" value_list_field="ValueList" />
+ </td>
+</inp2:m_DefineElement>
+
+
+<inp2:m_block name="grid_original_td" />
+ <td valign="top" class="text"><inp2:Field field="$field" grid="$grid"/></td>
+<inp2:m_blockend />
+
+<!--<inp2:m_DefineElement name="edit_custom_td">
+ <td valign="top" class="text">
+ <input type="hidden" name="<inp2:InputName field="ResourceId"/>" id="<inp2:InputName field="ResourceId"/>" value="<inp2:Field field="ResourceId" grid="$grid"/>">
+ <input type="hidden" name="<inp2:InputName field="CustomDataId"/>" id="<inp2:InputName field="CustomDataId"/>" value="<inp2:Field field="CustomDataId" grid="$grid"/>">
+ <inp2:ConfigFormElement field="Value" blocks_prefix="config_edit_" element_type_field="ElementType" value_list_field="ValueList" />
+ </td>
+</inp2:m_DefineElement>-->
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.8.2/kernel/admin_templates/incs/custom_blocks.tpl
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.8
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.8.2/kernel/admin_templates/stylesheets/stylesheets_list.tpl
===================================================================
--- branches/unlabeled/unlabeled-1.8.2/kernel/admin_templates/stylesheets/stylesheets_list.tpl (nonexistent)
+++ branches/unlabeled/unlabeled-1.8.2/kernel/admin_templates/stylesheets/stylesheets_list.tpl (revision 6146)
@@ -0,0 +1,75 @@
+<inp2:m_RequireLogin permissions="in-portal:configure_styles.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" icon="icon46_style" title="!la_title_Stylesheets!"/>
+
+<inp2:m_ParseBlock name="blue_bar" prefix="css" title_preset="styles_list" module="in-portal" icon="icon46_style"/>
+
+<!-- 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()
+ {
+ std_edit_item('css', 'stylesheets/stylesheets_edit');
+ }
+
+ var a_toolbar = new ToolBar();
+ a_toolbar.AddButton( new ToolBarButton('new_style', '<inp2:m_phrase label="la_ToolTip_NewStylesheet" escape="1"/>',
+ function() {
+ std_precreate_item('css', 'stylesheets/stylesheets_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() {
+ std_delete_items('css')
+ } ) );
+
+ a_toolbar.AddButton( new ToolBarSeparator('sep1') );
+
+ a_toolbar.AddButton( new ToolBarButton('approve', '<inp2:m_phrase label="la_ToolTip_Approve" escape="1"/>', function() {
+ submit_event('css','OnMassApprove');
+ }
+ ) );
+
+ a_toolbar.AddButton( new ToolBarButton('decline', '<inp2:m_phrase label="la_ToolTip_Decline" escape="1"/>', function() {
+ submit_event('css','OnMassDecline');
+ }
+ ) );
+
+ a_toolbar.AddButton( new ToolBarSeparator('sep2') );
+
+ a_toolbar.AddButton( new ToolBarButton('clone', '<inp2:m_phrase label="la_ToolTip_Clone" escape="1"/>', function() {
+ submit_event('css','OnMassClone');
+ }
+ ) );
+
+ a_toolbar.AddButton( new ToolBarSeparator('sep3') );
+
+ 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_block name="grid_description_td" no_special=""/>
+ <td valign="top" class="text"><inp2:$PrefixSpecial_field field="$field" grid="$grid" no_special="$no_special" cut_first="100"/></td>
+<inp2:m_blockend />
+
+<inp2:m_ParseBlock name="grid" PrefixSpecial="css" IdField="StylesheetId" grid="Default" menu_filters="yes"/>
+<script type="text/javascript">
+ Grids['css'].SetDependantToolbarButtons( new Array('edit','delete','approve','decline','clone') );
+</script>
+
+<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.8.2/kernel/admin_templates/stylesheets/stylesheets_list.tpl
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.8
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.8.2/admin/import/step2.php
===================================================================
--- branches/unlabeled/unlabeled-1.8.2/admin/import/step2.php (nonexistent)
+++ branches/unlabeled/unlabeled-1.8.2/admin/import/step2.php (revision 6146)
@@ -0,0 +1,76 @@
+<?php
+
+// new startup: begin
+define('REL_PATH', 'admin/import');
+$relation_level = count( explode('/', REL_PATH) );
+define('FULL_PATH', realpath(dirname(__FILE__) . str_repeat('/..', $relation_level) ) );
+require_once FULL_PATH.'/kernel/startup.php';
+// new startup: end
+checkViewPermission('in-portal:main_import');
+
+$pathtolocal = $pathtoroot."kernel/";
+require_once ($pathtoroot.$admin."/include/elements.php");
+require_once ($pathtoroot."kernel/admin/include/navmenu.php");
+require_once ($pathtolocal."admin/include/navmenu.php");
+require_once($pathtoroot.$admin."/toolbar.php");
+ //Set Section
+ $section = "in-portal:main_import";
+
+ //Set Environment Variable
+ $envar = "env=" . BuildEnv();
+ $var = '?env='.BuildEnv();
+
+ $sec = $objSections->GetSection($section);
+ $objCatToolBar = new clsToolBar();
+
+ // Previous Button
+ $MouseOver="swap('moveleft','toolbar/tool_prev_f2.gif');";
+ $MouseOut="swap('moveleft', 'toolbar/tool_prev.gif');";
+ $link = $adminURL.'/import/step1.php'.$var;
+ $objCatToolBar->Add('moveleft','la_ToolTip_PreviousStep', $link, $MouseOver, $MouseOut,'','tool_prev.gif');
+
+ // Next Button
+ $MouseOver = "if( ChoiseMade('import_form','choose') !== false ) swap('moveright','toolbar/tool_next_f2.gif');";
+ $MouseOut = "if( ChoiseMade('import_form','choose') !== false ) swap('moveright', 'toolbar/tool_next.gif');";
+
+ if($ro_perm)
+ {
+ $click_url = $adminURL."/import/step1.php".$var;
+ $onClick = "if( ChoiseMade('import_form','choose') ) document.location= '$click_url'; ";
+ }
+ else
+ {
+ $application =& kApplication::Instance();
+ $click_url = $application->HREF('import_redirect', '', null, 'index.php'); // $adminURL."/import/step3.php".$var;
+ $onClick = "ImportRedirect('import_form', ChoiseMade('import_form','choose'), '$click_url');";
+ }
+ $objCatToolBar->Add("moveright",'la_ToolTip_NextStep','#',$MouseOver,$MouseOut,$onClick,"tool_next_f3.gif");
+
+ // header
+ $title = admin_language("la_performing_import")." - ".admin_language("la_Step")." 2";
+ int_header($objCatToolBar,NULL,$title);
+
+ $objSession->SetVariable("ReturnScript", 'browse.php'); // return to catalog if import is made
+
+?>
+<form name="import_form" id="import_form" method="post" action="<?php echo $click_url; ?>">
+ <input type="hidden" name="import_id" id="import_id" value="">
+<table width="100%" border="0" cellspacing="0" cellpadding="4" class="tableborder">
+
+ <?php int_subsection_title("Import Source"); ?>
+ <tr <?php echo int_table_color(); ?>>
+ <td><span class="text">Select the program you are importing the data from:</span></td>
+ </tr>
+ <tr <?php echo int_table_color(); ?>>
+ <td>
+ <?php
+ foreach($import_scripts as $id => $iscript)
+ echo '<input type="radio" name="choose" id="ch'.$id.'" value="'.$id.'" onclick="swap(\'moveright\', \'toolbar/tool_next.gif\')"'.(!$iscript['enabled'] ? ' disabled="true"' : '').'><span class="text"><label for="ch'.$id.'">'.$iscript['label'].'</label></span><br />'."\n";
+ ?>
+ </td>
+ </tr>
+</table>
+</form>
+<?php
+int_footer();
+?>
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.8.2/admin/import/step2.php
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.8
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.8.2/core/units/general/helpers/multilanguage.php
===================================================================
--- branches/unlabeled/unlabeled-1.8.2/core/units/general/helpers/multilanguage.php (nonexistent)
+++ branches/unlabeled/unlabeled-1.8.2/core/units/general/helpers/multilanguage.php (revision 6146)
@@ -0,0 +1,240 @@
+<?php
+
+ /**
+ * Performs action on multilingual fields
+ *
+ */
+ class kMultiLanguageHelper extends kHelper {
+
+ var $languageCount = 0;
+
+ /**
+ * Structure of table, that is currently processed
+ *
+ * @var Array
+ */
+ var $curStructure = Array();
+
+ /**
+ * Field, to get structure information from
+ *
+ * @var string
+ */
+ var $curSourceField = false;
+
+ /**
+ * Indexes used in table of 32
+ *
+ * @var int
+ */
+ var $curIndexCount = 0;
+
+ /**
+ * Fields from config, that are currently used
+ *
+ * @var Array
+ */
+ var $curFields = Array();
+
+ function kMultiLanguageHelper()
+ {
+ parent::kHelper();
+ $this->languageCount = $this->getLanguageCount();
+ }
+
+ /**
+ * Returns language count in system (always is divisible by 5)
+ *
+ */
+ function getLanguageCount()
+ {
+ $table_name = $this->Application->getUnitOption('lang', 'TableName');
+ $languages_count = $this->Conn->GetOne('SELECT COUNT(*) FROM '.$table_name);
+ if (!$languages_count) {
+ // during installation we have not languages, but we need to created custom field columns
+ $languages_count = 1;
+ }
+ return $languages_count + 5 - ( $languages_count % 5 ? ($languages_count % 5) : 5 );
+ }
+
+
+ function scanTable($mask)
+ {
+ $i = 0;
+ $fields_found = 0;
+ $fields = array_keys($this->curStructure);
+
+ foreach ($fields as $field_name) {
+ if (preg_match($mask, $field_name)) {
+ $fields_found++;
+ }
+ }
+ return $fields_found;
+ }
+
+ function readTableStructure($table_name, $refresh=false)
+ {
+ static $structure_status = Array();
+
+ if ($refresh || !getArrayValue($structure_status, $table_name)) {
+ $this->curStructure = $this->Conn->Query('DESCRIBE '.$table_name, 'Field');
+ $this->curIndexCount = count($this->Conn->Query('SHOW INDEXES FROM '.$table_name));
+ $structure_status[$table_name] = true;
+ }
+ }
+
+ /**
+ * Creates missing multilanguage fields in table by specified prefix
+ *
+ * @param string $prefix
+ * @param bool $refresh Forces config field structure to be re-read from database
+ */
+ function createFields($prefix, $refresh = false)
+ {
+ if ($refresh) {
+ $this->Application->HandleEvent( new kEvent($prefix.':OnCreateCustomFields') );
+ }
+
+ $table_name = $this->Application->getUnitOption($prefix, 'TableName');
+ $this->curFields = $this->Application->getUnitOption($prefix, 'Fields');
+
+ if (!($table_name && $this->curFields) ) {
+ // invalid config found or prefix not found
+ return true;
+ }
+
+ $sqls = Array();
+ $this->readTableStructure($table_name, $refresh);
+
+ foreach($this->curFields as $field_name => $field_options)
+ {
+ if (getArrayValue($field_options, 'formatter') == 'kMultiLanguage') {
+ if (isset($field_options['master_field'])) {
+ unset($this->curFields[$field_name]);
+ continue;
+ }
+
+ $created_count = $this->getCreatedCount($field_name);
+ $create_count = $this->languageCount - $created_count;
+ if ($create_count > 0) {
+ // `l77_Name` VARCHAR( 255 ) NULL DEFAULT '0';
+ $field_mask = Array();
+ $field_mask['name'] = 'l%s_'.$field_name;
+ $field_mask['null'] = getArrayValue($field_options, 'not_null') ? 'NOT NULL' : 'NULL';
+
+ if ($this->curSourceField) {
+ $default_value = $this->getFieldParam('Default') != 'NULL' ? $this->Conn->qstr($this->getFieldParam('Default')) : $this->getFieldParam('Default');
+ $field_mask['type'] = $this->getFieldParam('Type');
+ }
+ else {
+ $default_value = is_null($field_options['default']) ? 'NULL' : $this->Conn->qstr($field_options['default']);
+ $field_mask['type'] = $field_options['db_type'];
+ }
+ $field_mask['default'] = 'DEFAULT '.$default_value;
+ $field_mask = $field_mask['name'].' '.$field_mask['type'].' '.$field_mask['null'].' '.$field_mask['default'];
+
+ $sqls[] = 'ALTER TABLE '.$table_name.( $this->generateAlterSQL($field_mask, $created_count + 1, $create_count) );
+ }
+ }
+ }
+
+ foreach ($sqls as $sql_query) {
+ $this->Conn->Query($sql_query);
+ }
+ }
+
+ function deleteField($prefix, $custom_id)
+ {
+ $table_name = $this->Application->getUnitOption($prefix, 'TableName');
+ $sql = 'DESCRIBE '.$table_name.' "l%_cust_'.$custom_id.'"';
+ $fields = $this->Conn->GetCol($sql);
+
+ $sql = 'ALTER TABLE '.$table_name.' ';
+ $sql_template = 'DROP COLUMN %s, ';
+ foreach ($fields as $field_name) {
+ $sql .= sprintf($sql_template, $field_name);
+ }
+ $sql = preg_replace('/(.*), $/', '\\1', $sql);
+ $this->Conn->Query($sql);
+ }
+
+ /**
+ * Returns parameter requested of current source field
+ *
+ * @param string $param_name
+ * @return string
+ */
+ function getFieldParam($param_name)
+ {
+ return $this->curStructure[$this->curSourceField][$param_name];
+ }
+
+ function getCreatedCount($field_name)
+ {
+ $ret = $this->scanTable('/^l[\d]+_'.preg_quote($field_name, '/').'/');
+ if (!$ret) {
+ // no multilingual fields at all (but we have such field without language prefix)
+ $original_found = $this->scanTable('/'.preg_quote($field_name, '/').'/');
+ $this->curSourceField = $original_found ? $field_name : false;
+ }
+ else {
+ $this->curSourceField = 'l1_'.$field_name;
+ }
+ return $ret;
+ }
+ /**
+ * Returns ALTER statement part for adding required fields to table
+ *
+ * @param string $field_mask sql mask for creating field with correct definition (type & size)
+ * @param int $start_index add new fields starting from this index
+ * @param int $create_count create this much new multilingual field translations
+ * @return string
+ */
+ function generateAlterSQL($field_mask, $start_index, $create_count)
+ {
+ static $single_lang = null;
+ if (!isset($single_lang)) {
+ // if single language mode, then create indexes only on primary columns
+ $table_name = $this->Application->getUnitOption('lang', 'TableName');
+ $sql = 'SELECT COUNT(*)
+ FROM '.$table_name.'
+ WHERE Enabled = 1';
+ // if language count = 0, then assume it's multi language mode
+ $single_lang = $this->Conn->GetOne($sql) == 1;
+ }
+
+ $ret = ' ';
+ $i_count = $start_index + $create_count;
+ while ($start_index < $i_count) {
+ list($prev_field,$type) = explode(' ', sprintf($field_mask, $start_index - 1) );
+ if (substr($prev_field, 0, 3) == 'l0_') {
+ $prev_field = substr($prev_field, 3, strlen($prev_field));
+ if (!$this->curSourceField) {
+ // get field name before this one
+ $fields = array_keys($this->curFields);
+// $prev_field = key(end($this->curStructure));
+ $prev_field = $fields[array_search($prev_field, $fields) - 1];
+ if (getArrayValue($this->curFields[$prev_field], 'formatter') == 'kMultiLanguage') {
+ $prev_field = 'l'.$this->languageCount.'_'.$prev_field;
+ }
+ }
+ }
+
+ $field_expression = sprintf($field_mask, $start_index);
+ $ret .= 'ADD COLUMN '.$field_expression.' AFTER `'.$prev_field.'`, ';
+
+ if ($this->curIndexCount < 32 && ($start_index == $this->Application->GetDefaultLanguageId() || !$single_lang)) {
+ // create index for primary language column + for all others (if multiple languages installed)
+ list($field_name, $field_params) = explode(' ', $field_expression, 2);
+ $ret .= 'ADD INDEX (`'.$field_name.'` (5) ), ';
+ $this->curIndexCount++;
+ }
+
+ $start_index++;
+ }
+ return preg_replace('/, $/',';',$ret);
+ }
+ }
+
+
+?>
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.8.2/core/units/general/helpers/multilanguage.php
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.8
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.8.2/core/admin_templates/incs/custom_blocks.tpl
===================================================================
--- branches/unlabeled/unlabeled-1.8.2/core/admin_templates/incs/custom_blocks.tpl (nonexistent)
+++ branches/unlabeled/unlabeled-1.8.2/core/admin_templates/incs/custom_blocks.tpl (revision 6146)
@@ -0,0 +1,104 @@
+<inp2:m_DefineElement name="config_edit_text">
+ <input type="text" name="<inp2:CustomInputName/>" value="<inp2:Field field="$field"/>" />
+</inp2:m_DefineElement>
+
+<inp2:m_DefineElement name="config_edit_password">
+ <input type="password" primarytype="password" name="<inp2:CustomInputName/>" id="<inp2:CustomInputName/>" value="" />
+ <input type="password" name="verify_<inp2:CustomInputName/>" id="verify_<inp2:CustomInputName/>" value="" />
+ <span class="error" id="error_<inp2:CustomInputName/>"></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:CustomInputName/>">
+ <inp2:PredefinedOptions field="$field" block="config_edit_option" selected="selected"/>
+ </select>
+</inp2:m_DefineElement>
+
+<inp2:m_DefineElement name="config_edit_checkbox">
+ <input type="hidden" id="<inp2:CustomInputName/>" name="<inp2:CustomInputName/>" 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:m_param name="field"/>" <inp2:Field field="$field" checked="checked" db="db"/> onclick="update_checkbox(this, document.getElementById('<inp2:CustomInputName/>'))">
+</inp2:m_DefineElement>
+
+<inp2:m_DefineElement name="config_edit_textarea">
+ <textarea name="<inp2:CustomInputName/>" <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:CustomInputName/>" id="<inp2:CustomInputName/>_<inp2:m_param name="key"/>" value="<inp2:m_param name="key"/>"><label for="<inp2:CustomInputName/>_<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_edit_date">
+ <inp2:m_if check="m_GetEquals" name="calendar_included" value="1" inverse="inverse">
+ <script type="text/javascript" src="incs/calendar.js"></script>
+ <inp2:m_set calendar_included="1"/>
+ </inp2:m_if>
+
+ <input type="text" name="<inp2:CustomInputName append="_date"/>" id="<inp2:CustomInputName append="_date"/>" value="<inp2:CustomField append="_date" format="_regional_InputDateFormat"/>" size="<inp2:CustomFormat append="_date" input_format="1" edit_size="edit_size"/>" datepickerIcon="<inp2:m_ProjectBase/>admin/images/ddarrow.gif"> <span class="small">(<inp2:CustomFormat append="_date" input_format="1" human="true"/>)</span>
+ <script type="text/javascript">
+ initCalendar("<inp2:CustomInputName append="_date"/>", "<inp2:CustomFormat append="_date" input_format="1"/>");
+ </script>
+ <input type="hidden" name="<inp2:CustomInputName append="_time"/>" value="">
+</inp2:m_DefineElement>
+
+<inp2:m_DefineElement name="config_edit_datetime">
+ <inp2:m_if check="m_GetEquals" name="calendar_included" value="1" inverse="inverse">
+ <script type="text/javascript" src="incs/calendar.js"></script>
+ <inp2:m_set calendar_included="1"/>
+ </inp2:m_if>
+
+ <input type="text" name="<inp2:CustomInputName append="_date"/>" id="<inp2:CustomInputName append="_date"/>" value="<inp2:CustomField append="_date" format="_regional_InputDateFormat"/>" size="<inp2:CustomFormat append="_date" input_format="1" edit_size="edit_size"/>" datepickerIcon="<inp2:m_ProjectBase/>admin/images/ddarrow.gif"> <span class="small">(<inp2:CustomFormat append="_date" input_format="1" human="true"/>)</span>
+ <script type="text/javascript">
+ initCalendar("<inp2:CustomInputName append="_date"/>", "<inp2:CustomFormat append="_date" input_format="1"/>");
+ </script>
+ <input type="text" name="<inp2:CustomInputName append="_time"/>" id="<inp2:CustomInputName append="_time"/>" value="<inp2:CustomField append="_time" format="_regional_InputTimeFormat"/>" size="<inp2:CustomFormat append="_time" input_format="1" edit_size="edit_size"/>"><span class="small"> (<inp2:CustomFormat append="_time" input_format="1" human="true"/>)</span>
+</inp2:m_DefineElement>
+
+<inp2:m_DefineElement name="cv_row_block">
+ <inp2:m_if check="m_ParamEquals" name="show_heading" value="1">
+ <tr class="subsectiontitle">
+ <td colspan="3">
+ <inp2:Field name="Heading" as_label="1"/>
+ </td>
+ <inp2:m_if check="{$SourcePrefix}_DisplayOriginal" pass_params="1">
+ <td><inp2:m_phrase name="$original_title"/></td>
+ </inp2:m_if>
+ </tr>
+ </inp2:m_if>
+ <tr class="<inp2:m_odd_even odd="table_color1" even="table_color2"/>" >
+ <inp2:m_ParseBlock name="grid_data_label_ml_td" grid="$grid" SourcePrefix="$SourcePrefix" value_field="$value_field" ElementTypeField="ElementType" field="Prompt" PrefixSpecial="$PrefixSpecial"/>
+ <td valign="top" class="text">
+ <inp2:ConfigFormElement field="Value" blocks_prefix="config_edit_" element_type_field="ElementType" value_list_field="ValueList" />
+ </td>
+ <td class="error"><inp2:CustomError/> </td>
+ <inp2:m_if check="{$SourcePrefix}_DisplayOriginal" pass_params="1">
+ <inp2:m_RenderElement prefix="$SourcePrefix" field="$field" name="inp_original_label"/>
+ </inp2:m_if>
+ </tr>
+</inp2:m_DefineElement>
+
+<inp2:m_DefineElement name="edit_custom_td">
+ <td valign="top" class="text">
+ <inp2:ConfigFormElement field="Value" blocks_prefix="config_edit_" element_type_field="ElementType" value_list_field="ValueList" />
+ </td>
+</inp2:m_DefineElement>
+
+
+<inp2:m_block name="grid_original_td" />
+ <td valign="top" class="text"><inp2:Field field="$field" grid="$grid"/></td>
+<inp2:m_blockend />
+
+<!--<inp2:m_DefineElement name="edit_custom_td">
+ <td valign="top" class="text">
+ <input type="hidden" name="<inp2:InputName field="ResourceId"/>" id="<inp2:InputName field="ResourceId"/>" value="<inp2:Field field="ResourceId" grid="$grid"/>">
+ <input type="hidden" name="<inp2:InputName field="CustomDataId"/>" id="<inp2:InputName field="CustomDataId"/>" value="<inp2:Field field="CustomDataId" grid="$grid"/>">
+ <inp2:ConfigFormElement field="Value" blocks_prefix="config_edit_" element_type_field="ElementType" value_list_field="ValueList" />
+ </td>
+</inp2:m_DefineElement>-->
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.8.2/core/admin_templates/incs/custom_blocks.tpl
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.8
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Index: branches/unlabeled/unlabeled-1.8.2/core/admin_templates/stylesheets/stylesheets_list.tpl
===================================================================
--- branches/unlabeled/unlabeled-1.8.2/core/admin_templates/stylesheets/stylesheets_list.tpl (nonexistent)
+++ branches/unlabeled/unlabeled-1.8.2/core/admin_templates/stylesheets/stylesheets_list.tpl (revision 6146)
@@ -0,0 +1,75 @@
+<inp2:m_RequireLogin permissions="in-portal:configure_styles.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" icon="icon46_style" title="!la_title_Stylesheets!"/>
+
+<inp2:m_ParseBlock name="blue_bar" prefix="css" title_preset="styles_list" module="in-portal" icon="icon46_style"/>
+
+<!-- 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()
+ {
+ std_edit_item('css', 'stylesheets/stylesheets_edit');
+ }
+
+ var a_toolbar = new ToolBar();
+ a_toolbar.AddButton( new ToolBarButton('new_style', '<inp2:m_phrase label="la_ToolTip_NewStylesheet" escape="1"/>',
+ function() {
+ std_precreate_item('css', 'stylesheets/stylesheets_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() {
+ std_delete_items('css')
+ } ) );
+
+ a_toolbar.AddButton( new ToolBarSeparator('sep1') );
+
+ a_toolbar.AddButton( new ToolBarButton('approve', '<inp2:m_phrase label="la_ToolTip_Approve" escape="1"/>', function() {
+ submit_event('css','OnMassApprove');
+ }
+ ) );
+
+ a_toolbar.AddButton( new ToolBarButton('decline', '<inp2:m_phrase label="la_ToolTip_Decline" escape="1"/>', function() {
+ submit_event('css','OnMassDecline');
+ }
+ ) );
+
+ a_toolbar.AddButton( new ToolBarSeparator('sep2') );
+
+ a_toolbar.AddButton( new ToolBarButton('clone', '<inp2:m_phrase label="la_ToolTip_Clone" escape="1"/>', function() {
+ submit_event('css','OnMassClone');
+ }
+ ) );
+
+ a_toolbar.AddButton( new ToolBarSeparator('sep3') );
+
+ 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_block name="grid_description_td" no_special=""/>
+ <td valign="top" class="text"><inp2:$PrefixSpecial_field field="$field" grid="$grid" no_special="$no_special" cut_first="100"/></td>
+<inp2:m_blockend />
+
+<inp2:m_ParseBlock name="grid" PrefixSpecial="css" IdField="StylesheetId" grid="Default" menu_filters="yes"/>
+<script type="text/javascript">
+ Grids['css'].SetDependantToolbarButtons( new Array('edit','delete','approve','decline','clone') );
+</script>
+
+<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Property changes on: branches/unlabeled/unlabeled-1.8.2/core/admin_templates/stylesheets/stylesheets_list.tpl
___________________________________________________________________
Added: cvs2svn:cvs-rev
## -0,0 +1 ##
+1.8
\ No newline at end of property
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Event Timeline
Log In to Comment