Page Menu
Home
In-Portal Phabricator
Search
Configure Global Search
Log In
Files
F1043142
in-link
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
Mon, Jun 23, 4:43 PM
Size
13 KB
Mime Type
text/x-diff
Expires
Wed, Jun 25, 4:43 PM (1 h, 41 s)
Engine
blob
Format
Raw Data
Handle
674731
Attached To
rMINL Modules.In-Link
in-link
View Options
Index: branches/5.1.x/units/link_validation/link_validation_tp.php
===================================================================
--- branches/5.1.x/units/link_validation/link_validation_tp.php (revision 13786)
+++ branches/5.1.x/units/link_validation/link_validation_tp.php (revision 13787)
@@ -1,66 +1,60 @@
<?php
/**
* @version $Id$
* @package In-Link
* @copyright Copyright (C) 1997 - 2009 Intechnic. All rights reserved.
* @license GNU/GPL
* In-Portal is Open Source software.
* This means that this software may have been modified pursuant
* the GNU General Public License, and as distributed it includes
* or is derivative of works licensed under the GNU General Public License
* or other free or open source software licenses.
* See http://www.in-portal.org/license for copyright notices and details.
*/
defined('FULL_PATH') or die('restricted access!');
class LinkValidationTagProcessor extends kDBTagProcessor {
function FormatUrl($params)
{
$object =& $this->getObject($params);
$url = $object->GetDBField($params['field']);
if (!preg_match('/^(http|ftp|mailto:)(.*)/U', $url)) {
$url = 'http://' . $url;
}
return $url;
}
/**
* Show CachedNavbar of current item primary category
*
* @param Array $params
* @return string
*/
function CategoryName($params)
{
// show category cachednavbar of
$object =& $this->getObject($params);
$category_id = isset($params['cat_id']) ? $params['cat_id'] : $object->GetDBField('CategoryId');
- $cache_key = 'category_paths[%CIDSerial:' . $category_id . '%]';
-
- if ($category_id == 0) {
- // home category name is phrase AND phrase name is defined in configuration
- $cache_key .= '[%PhrasesSerial%][%ConfSerial%]';
- }
-
+ $cache_key = 'category_paths[%CIDSerial:' . $category_id . '%][%PhrasesSerial%][Adm:' . (int)$this->Application->isAdmin . ']';
$category_path = $this->Application->getCache($cache_key);
if ($category_path === false) {
if ($category_id > 0) {
$cached_navbar = preg_replace('/^(Content&\|&|Content)/i', '', $object->GetDBField('CachedNavbar'));
$category_path = trim($this->CategoryName( Array('cat_id' => 0) ).' > '.str_replace('&|&', ' > ', $cached_navbar), ' > ');
}
else {
- $category_path = $this->Application->Phrase( $this->Application->ConfigValue('Root_Name') );
+ $category_path = $this->Application->Phrase(($this->Application->isAdmin ? 'la_' : 'lu_') . 'rootcategory_name');
}
$this->Application->setCache($cache_key, $category_path);
}
return $category_path;
}
}
\ No newline at end of file
Index: branches/5.1.x/admin_templates/import.tpl
===================================================================
--- branches/5.1.x/admin_templates/import.tpl (revision 13786)
+++ branches/5.1.x/admin_templates/import.tpl (revision 13787)
@@ -1,229 +1,229 @@
<inp2:adm_SetPopupSize width="780" height="670"/>
<inp2:m_include t="incs/header"/>
<inp2:l.import_PresetFormFields/>
<inp2:m_RenderElement name="combined_header" prefix="adm" section="in-portal:main_import" title_preset="import"/>
<!-- 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('import', '<inp2:m_phrase label="la_ToolTip_Import" escape="1"/>', function() {
document.getElementById('export_columns').value = select_to_string('<inp2:l.import_InputName field="ExportColumns"/>');
submit_event('l.import','OnExportBegin');
}
) );
a_toolbar.AddButton( new ToolBarButton('cancel', '<inp2:m_phrase label="la_ToolTip_Cancel" escape="1"/>', function() {
submit_event('l.import','OnGoBack');
}
) );
a_toolbar.Render();
function check_radio($id)
{
document.getElementById($id).checked = true;
}
// gets value of checked radio button
function get_checked($field_name) {
var $ret = false;
var $fields = document.getElementsByName($field_name);
for(var $i = 0; $i < $fields.length; $i++) {
if ($fields[$i].checked) {
$ret = $fields[$i].value;
break;
}
}
return $ret;
}
// enable/disable form fields based on other field values
function reflectFormFields()
{
var $auto_fields = get_checked('<inp2:l.import_InputName field="FieldTitles"/>') == 1 ? true : false;
if ($auto_fields) {
document.getElementById('_cb_<inp2:l.import_InputName field="SkipFirstRow"/>').checked = true;
}
document.getElementById('_cb_<inp2:l.import_InputName field="SkipFirstRow"/>').onchange();
document.getElementById('<inp2:l.import_InputName field="ExportColumns"/>').disabled = $auto_fields;
document.getElementById('<inp2:l.import_InputName field="AvailableColumns"/>').disabled = $auto_fields;
var $btn = null;
var $btns = Array('up', 'down', 'left', 'right');
var $i = 0;
while ($i < $btns.length) {
$btn = document.getElementById('btn_move_'+$btns[$i]);
$btn.disabled = $auto_fields;
$btn.className = $auto_fields ? 'button-disabled' : 'button';
$i++;
}
}
Application.setHook('l.import:OnBeforeOpenSelector',
function() {
document.getElementById('export_columns').value = select_to_string('<inp2:l.import_InputName field="ExportColumns"/>');
}
);
$(document).ready(
function() {
$('#step_number').text(3);
}
);
</script>
</td>
</tr>
</tbody>
</table>
<inp2:l.import_SaveWarning name="grid_save_warning"/>
<inp2:l.import_ErrorWarning name="form_error_warning"/>
<div id="scroll_container">
<table class="edit-form">
<inp2:m_RenderElement name="subsection" title="!la_section_General!"/>
<tr class="<inp2:m_odd_even odd='edit-form-odd' even='edit-form-even'/>">
<inp2:m_RenderElement name="inp_edit_field_caption" prefix="l.import" field="ImportSource" title="la_fld_ImportFilename"/>
<td class="control-cell">
<table border="0">
<tr>
<td>
<input type="radio" name="<inp2:l.import_InputName field="ImportSource"/>" id="<inp2:l.import_InputName field="ImportSource"/>_1"<inp2:m_if check="l.import_FieldEquals" field="ImportSource" value="1"> checked</inp2:m_if> value="1" />
</td>
<td>
<label for="<inp2:l.import_InputName field="ImportSource"/>_1">upload</label>
</td>
<td>
<input type="file" name="<inp2:l.import_InputName field="ImportFilename"/>" id="<inp2:l.import_InputName field="ImportFilename"/>" onclick="check_radio('<inp2:l.import_InputName field="ImportSource"/>_1');">
</td>
</tr>
<tr>
<td>
<input type="radio" name="<inp2:l.import_InputName field="ImportSource"/>" id="<inp2:l.import_InputName field="ImportSource"/>_2"<inp2:m_if check="l.import_FieldEquals" field="ImportSource" value="2"> checked</inp2:m_if> value="2" />
</td>
<td>
<label for="<inp2:l.import_InputName field="ImportSource"/>_2">select</label>
</td>
<td>
<select name="<inp2:l.import_InputName field="ImportLocalFilename"/>" onclick="check_radio('<inp2:l.import_InputName field="ImportSource"/>_2');">
<inp2:l.import_PredefinedOptions field="ImportLocalFilename" block="inp_option_item" selected="selected"/>
</select>
</td>
</tr>
</table>
</td>
<inp2:m_RenderElement name="inp_edit_error" prefix="l.import" field="ImportSource"/>
</tr>
<inp2:m_RenderElement name="inp_edit_box" prefix="l.import" field="FieldsSeparatedBy" title="la_fld_FieldsSeparatedBy" size="2" maxlength="1"/>
<inp2:m_RenderElement name="inp_edit_box" prefix="l.import" field="FieldsEnclosedBy" title="la_fld_FieldsEnclosedBy" size="2" maxlength="1"/>
<inp2:m_RenderElement name="inp_edit_radio" prefix="l.import" field="LineEndings" title="la_fld_LineEndings" use_phrases="0"/>
<inp2:m_RenderElement name="inp_edit_checkbox" prefix="l.import" field="SkipFirstRow" title="la_fld_SkipFirstRow"/>
<inp2:m_RenderElement name="inp_edit_radio" prefix="l.import" field="FieldTitles" title="la_fld_FieldTitles" onclick="reflectFormFields();"/>
<tr class="<inp2:m_odd_even odd='edit-form-odd' even='edit-form-even'/>">
<inp2:m_RenderElement name="inp_edit_field_caption" prefix="l.import" field="ExportColumns" title="la_fld_ImportColumns"/>
<td class="control-cell">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td>
<input type="button" value="<inp2:m_phrase name="la_btn_Up"/>" id="btn_move_up" onclick="move_options_up('<inp2:l.import_InputName field="ExportColumns"/>', 1)" class="button">
<input type="button" value="<inp2:m_phrase name="la_btn_Down"/>" id="btn_move_down" onclick="move_options_down('<inp2:l.import_InputName field="ExportColumns"/>', 1)" class="button"><br />
<img src="img/spacer.gif" width="1" height="5" alt=""><br />
</td>
<td><img src="img/spacer.gif" width="45" height="1" alt=""><br></td>
<td><inp2:m_phrase name="la_fld_AvailableColumns"/>:</td>
</tr>
<tr>
<td>
<select multiple id="<inp2:l.import_InputName field="ExportColumns"/>" size="15" style="width: 225px;">
<inp2:l.import_PredefinedOptions field="ExportColumns" block="inp_option_item" selected="selected"/>
</select>
<input type="hidden" id="export_columns" name="<inp2:l.import_InputName field="ExportColumns"/>" value="<inp2:l.import_Field field="ExportColumns"/>" />
</td>
<td align="center">
<input type="button" value=" «« " id="btn_move_left" onclick="move_selected('<inp2:l.import_InputName field="AvailableColumns"/>', '<inp2:l.import_InputName field="ExportColumns"/>')" class="button"><br>
<img src="img/spacer.gif" width="1" height="4" alt=""><br>
<input type="button" value=" »» " id="btn_move_right" onclick="move_selected('<inp2:l.import_InputName field="ExportColumns"/>', '<inp2:l.import_InputName field="AvailableColumns"/>'); select_sort('<inp2:l.import_InputName field="AvailableColumns"/>');" class="button">
</td>
<td>
<select multiple id="<inp2:l.import_InputName field="AvailableColumns"/>" size="15" style="width: 225px;">
<inp2:l.import_PredefinedOptions field="AvailableColumns" block="inp_option_item" selected="selected"/>
</select>
</td>
</tr>
</table>
</td>
<inp2:m_RenderElement name="inp_edit_error" prefix="l.import" field="ExportColumns"/>
</tr>
<!-- CATEGORY SELECTOR: BEGIN -->
<inp2:m_DefineElement name="root_cat_caption">
- <inp2:c_RootCategoryName/>
+ <inp2:m_Phrase name="la_rootcategory_name"/>
</inp2:m_DefineElement>
<inp2:m_DefineElement name="category_caption">
<inp2:m_param name="separator"/><inp2:m_param name="cat_name"/>
</inp2:m_DefineElement>
<tr class="<inp2:m_odd_even odd='edit-form-odd' even='edit-form-even'/>">
<inp2:m_RenderElement name="inp_edit_field_caption" prefix="l.import" field="CategoryId" title="la_fld_ImportCategory"/>
<td class="control-cell">
<b><inp2:l.import_CategoryPath separator=" > " root_cat_render_as="root_cat_caption" render_as="category_caption" session_var="ImportCategory"/></b>
<input type="hidden" name="<inp2:l.import_InputName field='CategoryId'/>" value="<inp2:l.import_Field field='CategoryId' db='db'/>" />
<a href="javascript:openSelector('l.import', '<inp2:adm_SelectorLink prefix="l.import" selection_mode="single" tab_prefixes="none"/>', 'ImportCategory', null, 'OnSaveSettings');"><img src="img/icons/icon24_cat.gif" border="0" align="absmiddle" /></a>
</td>
<inp2:m_RenderElement name="inp_edit_error" prefix="l.import" field="CategoryId"/>
</tr>
<!-- CATEGORY SELECTOR: END -->
<inp2:m_RenderElement name="inp_edit_box" prefix="l.import" field="CategorySeparator" title="la_fld_CategorySeparator" size="2" maxlength="1"/>
<inp2:m_RenderElement name="inp_edit_checkbox" prefix="l.import" field="ReplaceDuplicates" title="la_fld_ReplaceDuplicates" />
<tr class="<inp2:m_odd_even odd='edit-form-odd' even='edit-form-even'/>">
<inp2:m_RenderElement name="inp_edit_field_caption" prefix="l.import" field="CheckDuplicatesMethod" title="la_fld_CheckDuplicatesMethod"/>
<td class="control-cell">
<table cellspacing="0" cellpadding="0">
<tr>
<td valign="top">
<input type="radio"<inp2:m_if check="l.import_FieldEquals" field="CheckDuplicatesMethod" value="1"> checked</inp2:m_if> name="<inp2:l.import_InputName field="CheckDuplicatesMethod"/>" id="<inp2:l.import_InputName field="CheckDuplicatesMethod"/>_1" value="1" />
</td>
<td>
<label for="<inp2:l.import_InputName field="CheckDuplicatesMethod"/>_1"><inp2:m_phrase name="la_IDField" />: LINKID</label>
</td>
</tr>
<tr>
<td valign="top">
<input type="radio"<inp2:m_if check="l.import_FieldEquals" field="CheckDuplicatesMethod" value="2"> checked</inp2:m_if> name="<inp2:l.import_InputName field="CheckDuplicatesMethod"/>" id="<inp2:l.import_InputName field="CheckDuplicatesMethod"/>_2" value="2" />
</td>
<td>
<label for="<inp2:l.import_InputName field="CheckDuplicatesMethod"/>_2"><inp2:m_phrase name="la_OtherFields" />: </label>
<inp2:l.import_PredefinedOptions prefix="l.import" field="DuplicateCheckFields" block="inp_checkbox_item" selected="checked"/>
<inp2:m_RenderElement prefix="l.import" name="inp_edit_hidden" field="DuplicateCheckFields"/>
</td>
</tr>
</table>
</td>
<inp2:m_RenderElement name="inp_edit_error" prefix="l.import" field="CheckDuplicatesMethod"/>
</tr>
<inp2:m_RenderElement name="inp_edit_filler"/>
</table>
</div>
<script language="javascript" type="text/javascript">
reflectFormFields();
</script>
<inp2:m_include t="incs/footer"/>
\ No newline at end of file
Event Timeline
Log In to Comment