localization
Dieser Commit ist enthalten in:
Ursprung
07c09452f9
Commit
335ed4a0d5
|
@ -103,7 +103,7 @@ class pApiContentAllocationArticle extends pApiTree {
|
||||||
$this->tpl->next();
|
$this->tpl->next();
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->tpl->set('s', "CATEGORY", i18n("Category"));
|
$this->tpl->set('s', "CATEGORY", i18n("Category", "content_allocation"));
|
||||||
|
|
||||||
if ($return === true) {
|
if ($return === true) {
|
||||||
return $this->tpl->generate($this->template, true);
|
return $this->tpl->generate($this->template, true);
|
||||||
|
|
|
@ -108,5 +108,7 @@ class pApiContentAllocationComplexList extends pApiTree {
|
||||||
return $tree;
|
return $tree;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
|
@ -56,7 +56,7 @@ class pApiContentAllocationTreeView extends pApiTree {
|
||||||
public function __construct($uuid) {
|
public function __construct($uuid) {
|
||||||
global $cfg;
|
global $cfg;
|
||||||
|
|
||||||
parent::pApiTree($uuid);
|
parent::__construct($uuid);
|
||||||
$this->tpl = new Template;
|
$this->tpl = new Template;
|
||||||
$this->template = $cfg['pica']['treetemplate'];
|
$this->template = $cfg['pica']['treetemplate'];
|
||||||
}
|
}
|
||||||
|
@ -96,7 +96,7 @@ class pApiContentAllocationTreeView extends pApiTree {
|
||||||
controller.focus();
|
controller.focus();
|
||||||
function fieldCheck() {
|
function fieldCheck() {
|
||||||
if (controller.value == "") {
|
if (controller.value == "") {
|
||||||
alert("' . i18n("Please enter a category name") . '");
|
alert("' . i18n("Please enter a category name", "content_allocation") . '");
|
||||||
controller.focus();
|
controller.focus();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -120,23 +120,23 @@ class pApiContentAllocationTreeView extends pApiTree {
|
||||||
}
|
}
|
||||||
|
|
||||||
$item['ITEMINDENT'] = $item_tmp['level'] * 15 + 3;
|
$item['ITEMINDENT'] = $item_tmp['level'] * 15 + 3;
|
||||||
$item['ACTION_CREATE'] = '<a href="main.php?contenido=' . $sess->id . '&action=' . $action . '&frame=' . $frame . '&area=' . $area . '&step=add&parentid=' . $item_tmp['idpica_alloc'] . '"><img src="images/folder_new.gif" border="0" title="' . i18n("New category") . '" alt="' . i18n("New category") . '" /></a>';
|
$item['ACTION_CREATE'] = '<a href="main.php?contenido=' . $sess->id . '&action=' . $action . '&frame=' . $frame . '&area=' . $area . '&step=add&parentid=' . $item_tmp['idpica_alloc'] . '"><img src="images/folder_new.gif" border="0" title="' . i18n("New category", "content_allocation") . '" alt="' . i18n("New category", "content_allocation") . '" /></a>';
|
||||||
|
|
||||||
$item['ACTION_RENAME'] = '<a href="main.php?contenido=' . $sess->id . '&action=' . $action . '&frame=' . $frame . '&area=' . $area . '&step=rename&idpica_alloc=' . $item_tmp['idpica_alloc'] . '"><img src="images/but_todo.gif" width="16" height="16" border="0" alt="' . i18n("Rename category") . '" title="' . i18n("Rename category") . '" /></a>';
|
$item['ACTION_RENAME'] = '<a href="main.php?contenido=' . $sess->id . '&action=' . $action . '&frame=' . $frame . '&area=' . $area . '&step=rename&idpica_alloc=' . $item_tmp['idpica_alloc'] . '"><img src="images/but_todo.gif" width="16" height="16" border="0" alt="' . i18n("Rename category", "content_allocation") . '" title="' . i18n("Rename category", "content_allocation") . '" /></a>';
|
||||||
$item['ACTION_MOVE_UP'] = (count($result) >= 1) ? '<a href="main.php?contenido=' . $sess->id . '&action=' . $action . '&frame=' . $frame . '&area=' . $area . '&step=moveup&idpica_alloc=' . $item_tmp['idpica_alloc'] . '"><img src="images/folder_moveup.gif" border="0" alt="' . i18n("Move category up") . '" title="' . i18n("Move category up") . '" /></a>' : '<img src="images/spacer.gif" width="16" height="16" /></a>';
|
$item['ACTION_MOVE_UP'] = (count($result) >= 1) ? '<a href="main.php?contenido=' . $sess->id . '&action=' . $action . '&frame=' . $frame . '&area=' . $area . '&step=moveup&idpica_alloc=' . $item_tmp['idpica_alloc'] . '"><img src="images/folder_moveup.gif" border="0" alt="' . i18n("Move category up", "content_allocation") . '" title="' . i18n("Move category up", "content_allocation") . '" /></a>' : '<img src="images/spacer.gif" width="16" height="16" /></a>';
|
||||||
$item['ACTION_MOVE_DOWN'] = (count($result) >= 1) ? '<img src="images/folder_movedown.gif" border="0" alt="' . i18n("Move category down") . '" title="' . i18n("Move category down") . '" />' : '<img src="images/spacer.gif" width="16" height="16" />';
|
$item['ACTION_MOVE_DOWN'] = (count($result) >= 1) ? '<img src="images/folder_movedown.gif" border="0" alt="' . i18n("Move category down", "content_allocation") . '" title="' . i18n("Move category down", "content_allocation") . '" />' : '<img src="images/spacer.gif" width="16" height="16" />';
|
||||||
$item['ACTION_MOVE_DOWN'] = '';
|
$item['ACTION_MOVE_DOWN'] = '';
|
||||||
|
|
||||||
if ($item_tmp['online'] == 1) { // set offline
|
if ($item_tmp['online'] == 1) { // set offline
|
||||||
$item['ACTION_ONOFFLINE'] = '<a href="main.php?contenido=' . $sess->id . '&action=' . $action . '&frame=' . $frame . '&area=' . $area . '&step=offline&idpica_alloc=' . $item_tmp['idpica_alloc'] . '""><img src="images/online.gif" alt="' . i18n("Set category offline") . '" title="' . i18n("Set category offline") . '"></a>';
|
$item['ACTION_ONOFFLINE'] = '<a href="main.php?contenido=' . $sess->id . '&action=' . $action . '&frame=' . $frame . '&area=' . $area . '&step=offline&idpica_alloc=' . $item_tmp['idpica_alloc'] . '""><img src="images/online.gif" alt="' . i18n("Set category offline", "content_allocation") . '" title="' . i18n("Set category offline", "content_allocation") . '"></a>';
|
||||||
} else {
|
} else {
|
||||||
$item['ACTION_ONOFFLINE'] = '<a href="main.php?contenido=' . $sess->id . '&action=' . $action . '&frame=' . $frame . '&area=' . $area . '&step=online&idpica_alloc=' . $item_tmp['idpica_alloc'] . '""><img src="images/offline.gif" alt="' . i18n("Set category online") . '" title="' . i18n("Set category online") . '"></a>';
|
$item['ACTION_ONOFFLINE'] = '<a href="main.php?contenido=' . $sess->id . '&action=' . $action . '&frame=' . $frame . '&area=' . $area . '&step=online&idpica_alloc=' . $item_tmp['idpica_alloc'] . '""><img src="images/offline.gif" alt="' . i18n("Set category online", "content_allocation") . '" title="' . i18n("Set category online", "content_allocation") . '"></a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($item_tmp['children']) {
|
if ($item_tmp['children']) {
|
||||||
$item['ACTION_DELETE'] = '<img src="images/delete_inact.gif" border="0" alt="' . i18n("One or more subcategories exist, unable to delete") . '" title="' . i18n("One or more subcategories exist, unable to delete") . '">';
|
$item['ACTION_DELETE'] = '<img src="images/delete_inact.gif" border="0" alt="' . i18n("One or more subcategories exist, unable to delete", "content_allocation") . '" title="' . i18n("One or more subcategories exist, unable to delete", "content_allocation") . '">';
|
||||||
} else {
|
} else {
|
||||||
$item['ACTION_DELETE'] = '<a href="javascript://" onclick="box.confirm("' . i18n("Delete category") . '", "' . i18n("Are you sure to delete the following category") . ':<br><br><b>' . str_replace("'", "\'", $item_tmp['name']) . '</b>","deleteCategory(' . $item_tmp['idpica_alloc'] . ')");"><img src="images/delete.gif" border="0" alt="' . i18n("Delete category") . '" title="' . i18n("Delete category") . '"></a>';
|
$item['ACTION_DELETE'] = '<a href="javascript://" onclick="box.confirm("' . i18n("Delete category", "content_allocation") . '", "' . i18n("Are you sure to delete the following category", "content_allocation") . ':<br><br><b>' . str_replace("'", "\'", $item_tmp['name']) . '</b>","deleteCategory(' . $item_tmp['idpica_alloc'] . ')");"><img src="images/delete.gif" border="0" alt="' . i18n("Delete category", "content_allocation") . '" title="' . i18n("Delete category", "content_allocation") . '"></a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
array_push($result, $item);
|
array_push($result, $item);
|
||||||
|
@ -172,7 +172,7 @@ class pApiContentAllocationTreeView extends pApiTree {
|
||||||
controller.focus();
|
controller.focus();
|
||||||
function fieldCheck() {
|
function fieldCheck() {
|
||||||
if (controller.value == "") {
|
if (controller.value == "") {
|
||||||
alert("' . i18n("Please enter a category name") . '");
|
alert("' . i18n("Please enter a category name", "content_allocation") . '");
|
||||||
controller.focus();
|
controller.focus();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -219,8 +219,8 @@ class pApiContentAllocationTreeView extends pApiTree {
|
||||||
$this->tpl->next();
|
$this->tpl->next();
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->tpl->set('s', 'CATEGORY', i18n("Category"));
|
$this->tpl->set('s', 'CATEGORY', i18n("Category", "content_allocation"));
|
||||||
$this->tpl->set('s', 'ACTIONS', i18n("Actions"));
|
$this->tpl->set('s', 'ACTIONS', i18n("Actions", "content_allocation"));
|
||||||
|
|
||||||
if ($return === true) {
|
if ($return === true) {
|
||||||
return $this->tpl->generate($this->template, true);
|
return $this->tpl->generate($this->template, true);
|
||||||
|
|
|
@ -14,6 +14,10 @@
|
||||||
* $Id: config.autoloader.php 368 2015-10-27 10:32:42Z oldperl $
|
* $Id: config.autoloader.php 368 2015-10-27 10:32:42Z oldperl $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
if(!defined('CON_FRAMEWORK')) {
|
||||||
|
die('Illegal call');
|
||||||
|
}
|
||||||
|
|
||||||
$sAutoloadClassPath = 'conlite/plugins/content_allocation/classes/';
|
$sAutoloadClassPath = 'conlite/plugins/content_allocation/classes/';
|
||||||
return array(
|
return array(
|
||||||
'pApiContentAllocation' => $sAutoloadClassPath.'class.content_allocation.php',
|
'pApiContentAllocation' => $sAutoloadClassPath.'class.content_allocation.php',
|
||||||
|
|
|
@ -58,7 +58,7 @@ function pica_RenderArticleAction ($idcat, $idart, $idartlang, $actionkey)
|
||||||
|
|
||||||
if ($actionkey == "con_contentallocation")
|
if ($actionkey == "con_contentallocation")
|
||||||
{
|
{
|
||||||
return '<a title="'.i18n("Content Allocation").'" alt="'.i18n("Content Allocation").'" href="'.$sess->url('main.php?area=con_contentallocation&action=con_edit&idart='.$idart.'&idartlang='.$idartlang.'&idcat='.$idcat.'&frame=4').'"><img src="plugins/content_allocation/images/call_contentallocation.gif"></a>';
|
return '<a title="'.i18n("Content Allocation", "content_allocation").'" alt="'. i18n("Content Allocation", "content_allocation").'" href="'.$sess->url('main.php?area=con_contentallocation&action=con_edit&idart='.$idart.'&idartlang='.$idartlang.'&idcat='.$idcat.'&frame=4').'"><img src="plugins/content_allocation/images/call_contentallocation.gif"></a>';
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
return "";
|
return "";
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Project:
|
* Project:
|
||||||
* Contenido Content Management System
|
* Contenido Content Management System
|
||||||
|
@ -27,35 +28,35 @@
|
||||||
* }}
|
* }}
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
if (!defined('CON_FRAMEWORK')) {
|
||||||
if(!defined('CON_FRAMEWORK')) {
|
die('Illegal call');
|
||||||
die('Illegal call');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// check requests
|
// check requests
|
||||||
Contenido_Security::checkRequests();
|
Contenido_Security::checkRequests();
|
||||||
|
|
||||||
if(!($perm->have_perm_area_action($area, "storeallocation") || $perm->have_perm_area_action_item($area, "storeallocation", $idcat))) {
|
if (!($perm->have_perm_area_action($area, "storeallocation") || $perm->have_perm_area_action_item($area, "storeallocation", $idcat))) {
|
||||||
$notification->displayNotification("error", i18n("Permission denied"));
|
$notification->displayNotification("error", i18n("Permission denied", "content_allocation"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
cInclude("includes", "functions.pathresolver.php");
|
cInclude("includes", "functions.pathresolver.php");
|
||||||
|
|
||||||
function str_replace_recursive ($array) {
|
function str_replace_recursive($array) {
|
||||||
if (!is_array($array)) return false;
|
if (!is_array($array))
|
||||||
|
return false;
|
||||||
$result = array();
|
|
||||||
|
$result = array();
|
||||||
foreach ($array as $value) {
|
|
||||||
$result[] = str_replace("e", "", $value);
|
foreach ($array as $value) {
|
||||||
}
|
$result[] = str_replace("e", "", $value);
|
||||||
|
}
|
||||||
return $result;
|
|
||||||
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
// fetch idartlang for idart
|
// fetch idartlang for idart
|
||||||
$sql = "SELECT idartlang FROM ".$cfg['tab']['art_lang']." WHERE idart=".Contenido_Security::toInteger($idart)." AND idlang=".Contenido_Security::toInteger($lang);
|
$sql = "SELECT idartlang FROM " . $cfg['tab']['art_lang'] . " WHERE idart=" . Contenido_Security::toInteger($idart) . " AND idlang=" . Contenido_Security::toInteger($lang);
|
||||||
$db->query($sql);
|
$db->query($sql);
|
||||||
$db->next_record();
|
$db->next_record();
|
||||||
$this_idartlang = $db->f('idartlang');
|
$this_idartlang = $db->f('idartlang');
|
||||||
|
@ -67,19 +68,19 @@ $oTree = new pApiContentAllocationComplexList('06bd456d-fe76-40cb-b041-b9ba90dc4
|
||||||
$oAlloc = new pApiContentAllocation;
|
$oAlloc = new pApiContentAllocation;
|
||||||
|
|
||||||
if ($_POST['action'] == 'storeallocation') {
|
if ($_POST['action'] == 'storeallocation') {
|
||||||
$oAlloc->storeAllocations($this_idartlang, $_POST['allocation']);
|
$oAlloc->storeAllocations($this_idartlang, $_POST['allocation']);
|
||||||
}
|
}
|
||||||
if ($_GET['step'] == 'collapse') {
|
if ($_GET['step'] == 'collapse') {
|
||||||
$oTree->setTreeStatus($_GET['idpica_alloc']);
|
$oTree->setTreeStatus($_GET['idpica_alloc']);
|
||||||
}
|
}
|
||||||
|
|
||||||
#build category path
|
#build category path
|
||||||
$catString = '';
|
$catString = '';
|
||||||
prCreateURLNameLocationString($idcat, '/', $catString);
|
prCreateURLNameLocationString($idcat, '/', $catString);
|
||||||
$oArticle = new Article ($idart, $client, $lang);
|
$oArticle = new Article($idart, $client, $lang);
|
||||||
$sArticleTitle = $oArticle->getField('title');
|
$sArticleTitle = $oArticle->getField('title');
|
||||||
|
|
||||||
$sLocationString = "<div class=\"categorypath\">".$catString.'/'.clHtmlSpecialChars($sArticleTitle)."</div>";
|
$sLocationString = "<div class=\"categorypath\">" . $catString . '/' . clHtmlSpecialChars($sArticleTitle) . "</div>";
|
||||||
|
|
||||||
// load allocations
|
// load allocations
|
||||||
$loadedAllocations = $oAlloc->loadAllocations($this_idartlang);
|
$loadedAllocations = $oAlloc->loadAllocations($this_idartlang);
|
||||||
|
@ -88,43 +89,44 @@ $oTree->setChecked($loadedAllocations);
|
||||||
$result = $oTree->renderTree(true);
|
$result = $oTree->renderTree(true);
|
||||||
|
|
||||||
if ($result == false) {
|
if ($result == false) {
|
||||||
$result = $notification->returnNotification("warning", i18n('There is no Content Allocation tree.'));
|
$result = $notification->returnNotification("warning", i18n('There is no Content Allocation tree.', "content_allocation"));
|
||||||
} else {
|
} else {
|
||||||
if (!is_object($tpl)) { $tpl = new Template; }
|
if (!is_object($tpl)) {
|
||||||
$hiddenfields = '<input type="hidden" name="action" value="storeallocation">
|
$tpl = new Template;
|
||||||
<input type="hidden" name="idart" value="'.$idart.'">
|
}
|
||||||
<input type="hidden" name="contenido" value="'.$sess->id.'">
|
$hiddenfields = '<input type="hidden" name="action" value="storeallocation">
|
||||||
<input type="hidden" name="area" value="'.$area.'">
|
<input type="hidden" name="idart" value="' . $idart . '">
|
||||||
<input type="hidden" name="frame" value="'.$frame.'">
|
<input type="hidden" name="contenido" value="' . $sess->id . '">
|
||||||
<input type="hidden" name="idcat" value="'.$idcat.'">';
|
<input type="hidden" name="area" value="' . $area . '">
|
||||||
$tpl->set('s', 'HIDDENFIELDS', $hiddenfields);
|
<input type="hidden" name="frame" value="' . $frame . '">
|
||||||
|
<input type="hidden" name="idcat" value="' . $idcat . '">';
|
||||||
|
$tpl->set('s', 'HIDDENFIELDS', $hiddenfields);
|
||||||
if (sizeof($loadedAllocations) > 0) {
|
|
||||||
$tpl->set('s', 'ARRAY_CHECKED_BOXES', 'var checkedBoxes = [' . implode(',', $loadedAllocations) . '];');
|
|
||||||
} else {
|
|
||||||
$tpl->set('s', 'ARRAY_CHECKED_BOXES', 'var checkedBoxes = [];');
|
|
||||||
}
|
|
||||||
|
|
||||||
$oDiv = new cHTMLDiv;
|
|
||||||
$oDiv->updateAttributes(array('style' => 'text-align: right; padding: 5px; width: 730px; border: 1px #B3B3B3 solid; background-color: #FFFFFF;'));
|
|
||||||
$oDiv->setContent('<input type="image" src="images/but_ok.gif" />');
|
|
||||||
$tpl->set('s', 'DIV', '<br>' . $oDiv->render());
|
|
||||||
|
|
||||||
$tpl->set('s', 'TREE', $result);
|
|
||||||
|
|
||||||
$tpl->set('s', 'REMOVE_ALL', i18n("Remove all"));
|
|
||||||
$tpl->set('s', 'REMOVE', i18n("Remove"));
|
if (sizeof($loadedAllocations) > 0) {
|
||||||
|
$tpl->set('s', 'ARRAY_CHECKED_BOXES', 'var checkedBoxes = [' . implode(',', $loadedAllocations) . '];');
|
||||||
$result = $tpl->generate($cfg['pica']['treetemplate_complexlist'], true);
|
} else {
|
||||||
|
$tpl->set('s', 'ARRAY_CHECKED_BOXES', 'var checkedBoxes = [];');
|
||||||
$script = '<link rel="stylesheet" type="text/css" href="'.$cfg['pica']['style_complexlist'].'"/>
|
}
|
||||||
<script language="javascript" src="'.$cfg['pica']['script_complexlist'].'"></script>';
|
|
||||||
$oPage->addScript('style', $script);
|
$oDiv = new cHTMLDiv;
|
||||||
|
$oDiv->updateAttributes(array('style' => 'text-align: right; padding: 5px; width: 730px; border: 1px #B3B3B3 solid; background-color: #FFFFFF;'));
|
||||||
|
$oDiv->setContent('<input type="image" src="images/but_ok.gif" />');
|
||||||
|
$tpl->set('s', 'DIV', '<br>' . $oDiv->render());
|
||||||
|
|
||||||
|
$tpl->set('s', 'TREE', $result);
|
||||||
|
|
||||||
|
$tpl->set('s', 'REMOVE_ALL', i18n("Remove all", "content_allocation"));
|
||||||
|
$tpl->set('s', 'REMOVE', i18n("Remove", "content_allocation"));
|
||||||
|
|
||||||
|
$result = $tpl->generate($cfg['pica']['treetemplate_complexlist'], true);
|
||||||
|
|
||||||
|
$script = '<link rel="stylesheet" type="text/css" href="' . $cfg['pica']['style_complexlist'] . '"/>
|
||||||
|
<script language="javascript" src="' . $cfg['pica']['script_complexlist'] . '"></script>';
|
||||||
|
$oPage->addScript('style', $script);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$oPage->setContent($sLocationString.$result . markSubMenuItem(5, true));
|
$oPage->setContent($sLocationString . $result . markSubMenuItem(5, true));
|
||||||
$oPage->render();
|
$oPage->render();
|
||||||
|
|
||||||
?>
|
?>
|
|
@ -0,0 +1,22 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @package Plugins
|
||||||
|
* @subpackage ContentAllocation
|
||||||
|
* @version $Rev: 368 $
|
||||||
|
* @since 2.0
|
||||||
|
* @author Ortwin Pinke <o.pinke@conlite.org>
|
||||||
|
* @copyright 2017 CL-Team
|
||||||
|
* @link http://www.conlite.org
|
||||||
|
*
|
||||||
|
* $Id:$
|
||||||
|
*/
|
||||||
|
|
||||||
|
if(!defined('CON_FRAMEWORK')) {
|
||||||
|
die('Illegal call');
|
||||||
|
}
|
||||||
|
|
||||||
|
$oPage = new cPage();
|
||||||
|
$oPage->setHtml5();
|
||||||
|
|
||||||
|
$oPage->render();
|
|
@ -1,4 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Project:
|
* Project:
|
||||||
* Contenido Content Management System
|
* Contenido Content Management System
|
||||||
|
@ -27,33 +28,32 @@
|
||||||
* }}
|
* }}
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
if (!defined('CON_FRAMEWORK')) {
|
||||||
if(!defined('CON_FRAMEWORK')) {
|
die('Illegal call');
|
||||||
die('Illegal call');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($_REQUEST['treeItem'])) {
|
if (isset($_REQUEST['treeItem'])) {
|
||||||
die ('Illegal call!');
|
die('Illegal call!');
|
||||||
}
|
}
|
||||||
|
|
||||||
#added 24.06.08 timo.trautmann security fix filter submitted treeItemPost array before insertion, name also changed according to security fix
|
#added 24.06.08 timo.trautmann security fix filter submitted treeItemPost array before insertion, name also changed according to security fix
|
||||||
$aPostTreeItem = array();
|
$aPostTreeItem = array();
|
||||||
if (!is_object($db)) {
|
if (!is_object($db)) {
|
||||||
$db = new DB_ConLite();
|
$db = new DB_ConLite();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($_REQUEST['treeItemPost']['idpica_alloc'])) {
|
if (isset($_REQUEST['treeItemPost']['idpica_alloc'])) {
|
||||||
$aPostTreeItem['idpica_alloc'] = (int) $_REQUEST['treeItemPost']['idpica_alloc'];
|
$aPostTreeItem['idpica_alloc'] = (int) $_REQUEST['treeItemPost']['idpica_alloc'];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($_REQUEST['treeItemPost']['parentid'])) {
|
if (isset($_REQUEST['treeItemPost']['parentid'])) {
|
||||||
$aPostTreeItem['parentid'] = (int) $_REQUEST['treeItemPost']['parentid'];
|
$aPostTreeItem['parentid'] = (int) $_REQUEST['treeItemPost']['parentid'];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($_REQUEST['treeItemPost']['name'])) {
|
if (isset($_REQUEST['treeItemPost']['name'])) {
|
||||||
$sName = stripslashes($_REQUEST['treeItemPost']['name']);
|
$sName = stripslashes($_REQUEST['treeItemPost']['name']);
|
||||||
$sName =$db->escape($sName);
|
$sName = $db->escape($sName);
|
||||||
$aPostTreeItem['name'] = $sName;
|
$aPostTreeItem['name'] = $sName;
|
||||||
}
|
}
|
||||||
|
|
||||||
$_GET['idpica_alloc'] = (int) $_GET['idpica_alloc'];
|
$_GET['idpica_alloc'] = (int) $_GET['idpica_alloc'];
|
||||||
|
@ -65,41 +65,41 @@ $oPage->setMessageBox();
|
||||||
$oTree = new pApiContentAllocationTreeView('f7771624-4874-4745-8b7e-21a49a71a447');
|
$oTree = new pApiContentAllocationTreeView('f7771624-4874-4745-8b7e-21a49a71a447');
|
||||||
|
|
||||||
// store item
|
// store item
|
||||||
if ($_POST['step'] == 'store') {
|
if ($_POST['step'] == 'store') {
|
||||||
$pNotify = '<div style="width:410px;margin-bottom:20px;">';
|
$pNotify = '<div style="width:410px;margin-bottom:20px;">';
|
||||||
$sMessage = sprintf(i18n("New Category %s successfully stored!"), $treeItem['name']);
|
$sMessage = sprintf(i18n("New Category %s successfully stored!", "content_allocation"), $treeItem['name']);
|
||||||
$notification->displayNotification("info", $sMessage);
|
$notification->displayNotification("info", $sMessage);
|
||||||
$pNotify .= '</div>';
|
$pNotify .= '</div>';
|
||||||
$oTree->storeItem($aPostTreeItem);
|
$oTree->storeItem($aPostTreeItem);
|
||||||
}
|
}
|
||||||
// rename item
|
// rename item
|
||||||
if ($_POST['step'] == 'storeRename') {
|
if ($_POST['step'] == 'storeRename') {
|
||||||
$pNotify = '<div style="width:410px;margin-bottom:20px;">';
|
$pNotify = '<div style="width:410px;margin-bottom:20px;">';
|
||||||
$sMessage = sprintf(i18n("Category %s successfully renamed!"), $treeItem['name']);
|
$sMessage = sprintf(i18n("Category %s successfully renamed!", "content_allocation"), $treeItem['name']);
|
||||||
$notification->displayNotification("info", $sMessage);
|
$notification->displayNotification("info", $sMessage);
|
||||||
$pNotify .= '</div>';
|
$pNotify .= '</div>';
|
||||||
$oTree->storeItem($aPostTreeItem);
|
$oTree->storeItem($aPostTreeItem);
|
||||||
}
|
}
|
||||||
// rename item
|
// rename item
|
||||||
if ($_GET['step'] == 'moveup') {
|
if ($_GET['step'] == 'moveup') {
|
||||||
$oTree->itemMoveUp($_GET['idpica_alloc']);
|
$oTree->itemMoveUp($_GET['idpica_alloc']);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($_GET['step'] == 'deleteItem') { // delete item
|
if ($_GET['step'] == 'deleteItem') { // delete item
|
||||||
$pNotify = '<div style="width:410px;margin-bottom:20px;">';
|
$pNotify = '<div style="width:410px;margin-bottom:20px;">';
|
||||||
$sMessage = i18n("Category successfully deleted!");
|
$sMessage = i18n("Category successfully deleted!", "content_allocation");
|
||||||
$notification->displayNotification("info", $sMessage);
|
$notification->displayNotification("info", $sMessage);
|
||||||
$pNotify .= '</div>';
|
$pNotify .= '</div>';
|
||||||
$oTree->deleteItem($_GET['idpica_alloc']);
|
$oTree->deleteItem($_GET['idpica_alloc']);
|
||||||
}
|
}
|
||||||
if ($_GET['step'] == 'collapse') {
|
if ($_GET['step'] == 'collapse') {
|
||||||
$oTree->setTreeStatus($_GET['idpica_alloc']);
|
$oTree->setTreeStatus($_GET['idpica_alloc']);
|
||||||
}
|
}
|
||||||
if ($_GET['step'] == 'online') {
|
if ($_GET['step'] == 'online') {
|
||||||
$oTree->setOnline($_GET['idpica_alloc']);
|
$oTree->setOnline($_GET['idpica_alloc']);
|
||||||
}
|
}
|
||||||
if ($_GET['step'] == 'offline') {
|
if ($_GET['step'] == 'offline') {
|
||||||
$oTree->setOffline($_GET['idpica_alloc']);
|
$oTree->setOffline($_GET['idpica_alloc']);
|
||||||
}
|
}
|
||||||
|
|
||||||
$oDiv = new cHTMLDiv;
|
$oDiv = new cHTMLDiv;
|
||||||
|
@ -107,19 +107,19 @@ $oDiv->updateAttributes(array('style' => 'padding: 5px; width: 400px; border: 1p
|
||||||
$sTemp = '';
|
$sTemp = '';
|
||||||
|
|
||||||
if ($_GET['step'] == 'createRoot') { // create new root item
|
if ($_GET['step'] == 'createRoot') { // create new root item
|
||||||
$form = '
|
$form = '
|
||||||
<table cellspacing="0" cellpaddin="0" border="0">
|
<table cellspacing="0" cellpaddin="0" border="0">
|
||||||
<form name="create" action="main.php" method="POST" onsubmit="return fieldCheck();">
|
<form name="create" action="main.php" method="POST" onsubmit="return fieldCheck();">
|
||||||
<input type="hidden" name="action" value="'.$action.'" />
|
<input type="hidden" name="action" value="' . $action . '" />
|
||||||
<input type="hidden" name="frame" value="'.intval($frame).'" />
|
<input type="hidden" name="frame" value="' . intval($frame) . '" />
|
||||||
<input type="hidden" name="contenido" value="'.$sess->id.'" />
|
<input type="hidden" name="contenido" value="' . $sess->id . '" />
|
||||||
<input type="hidden" name="area" value="'.$area.'" />
|
<input type="hidden" name="area" value="' . $area . '" />
|
||||||
<input type="hidden" name="step" value="store" />
|
<input type="hidden" name="step" value="store" />
|
||||||
<input type="hidden" name="treeItemPost[parentid]" value="root" />
|
<input type="hidden" name="treeItemPost[parentid]" value="root" />
|
||||||
<tr><td colspan="2" class="text_medium">'.i18n("Create new tree").'</td></tr>
|
<tr><td colspan="2" class="text_medium">' . i18n("Create new tree", "content_allocation") . '</td></tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="text_medium"><input id="itemname" class="text_medium" type="text" name="treeItemPost[name]" value=""></td>
|
<td class="text_medium"><input id="itemname" class="text_medium" type="text" name="treeItemPost[name]" value=""></td>
|
||||||
<td> <a href="main.php?action='.$action.'&frame='.$frame.'&area='.$area.'&contenido='.$sess->id.'"><img src="images/but_cancel.gif" border="0" /></a>
|
<td> <a href="main.php?action=' . $action . '&frame=' . $frame . '&area=' . $area . '&contenido=' . $sess->id . '"><img src="images/but_cancel.gif" border="0" /></a>
|
||||||
<input type="image" src="images/but_ok.gif" /></td>
|
<input type="image" src="images/but_ok.gif" /></td>
|
||||||
</tr>
|
</tr>
|
||||||
</form>
|
</form>
|
||||||
|
@ -129,37 +129,36 @@ if ($_GET['step'] == 'createRoot') { // create new root item
|
||||||
controller.focus();
|
controller.focus();
|
||||||
function fieldCheck() {
|
function fieldCheck() {
|
||||||
if (controller.value == "") {
|
if (controller.value == "") {
|
||||||
alert("'.i18n("Please enter a category name.").'");
|
alert("' . i18n("Please enter a category name.", "content_allocation") . '");
|
||||||
controller.focus();
|
controller.focus();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
</script>';
|
</script>';
|
||||||
$oDiv->setContent($form);
|
$oDiv->setContent($form);
|
||||||
$sTemp = $oDiv->render();
|
$sTemp = $oDiv->render();
|
||||||
} else {
|
} else {
|
||||||
$newTree = '<a href="main.php?action='.$action.'&step=createRoot&frame='.$frame.'&area='.$area.'&contenido='.$sess->id.'"><img src="images/folder_new.gif" border="0" style="vertical-align: middle; margin-right: 5px;">'.i18n("Create new tree").'</a><div style="height:10px"></div>';
|
$newTree = '<a href="main.php?action=' . $action . '&step=createRoot&frame=' . $frame . '&area=' . $area . '&contenido=' . $sess->id . '"><img src="images/folder_new.gif" border="0" style="vertical-align: middle; margin-right: 5px;">' . i18n("Create new tree", "content_allocation") . '</a><div style="height:10px"></div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
$result = $oTree->renderTree(true);
|
$result = $oTree->renderTree(true);
|
||||||
|
|
||||||
if ($result === false) {
|
if ($result === false) {
|
||||||
$result = ' ';
|
$result = ' ';
|
||||||
}
|
}
|
||||||
|
|
||||||
$js = '
|
$js = '
|
||||||
<script language="javascript">
|
<script language="javascript">
|
||||||
/* Function for deleting categories*/
|
/* Function for deleting categories*/
|
||||||
function deleteCategory(idpica_alloc) {
|
function deleteCategory(idpica_alloc) {
|
||||||
var url = "main.php?area='.$area.'&action='.$action.'&step=deleteItem&idpica_alloc=" + idpica_alloc + "&frame='.$frame.'&contenido='.$sess->id.'";
|
var url = "main.php?area=' . $area . '&action=' . $action . '&step=deleteItem&idpica_alloc=" + idpica_alloc + "&frame=' . $frame . '&contenido=' . $sess->id . '";
|
||||||
window.location.href = url;
|
window.location.href = url;
|
||||||
}
|
}
|
||||||
</script>';
|
</script>';
|
||||||
|
|
||||||
$oPage->addScript('deleteCategory', $js);
|
$oPage->addScript('deleteCategory', $js);
|
||||||
|
|
||||||
$oPage->setContent($pNotify . $newTree . $sTemp. '<br/>' . $result);
|
$oPage->setContent($pNotify . $newTree . $sTemp . '<br/>' . $result);
|
||||||
$oPage->render();
|
$oPage->render();
|
||||||
|
|
||||||
?>
|
?>
|
Laden…
In neuem Issue referenzieren