diff --git a/.gitignore b/.gitignore deleted file mode 100644 index d8fe4fa..0000000 --- a/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/.project diff --git a/README.md b/README.md index fc6722e..b6f5e3b 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,2 @@ # cl-content-allocation Content Allocation Plugin for ConLite - -This plugin is f used to ad tags to your articles. - -History - -V 1.0.0 -- initial recode to use with CL pluginmanager diff --git a/cl_plugin.xml b/cl_plugin.xml deleted file mode 100644 index b1eacfa..0000000 --- a/cl_plugin.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - ConLite Conten-Allocation - cl-content-allocation - D02CBEF1-45A5-5144-821F-015F6F81EEE0 - ConLite Content Allocation - ConLite Team - ConLite Team - cl-content-allocation@conlite.org - https://conlite.org - 1.0.0 - - - - - - - content_allocation - con_contentallocation - - - storeallocation - - - - - - - - - - - - - \ No newline at end of file diff --git a/classes/class.content_allocation_article.php b/classes/class.content_allocation_article.php index a027f8f..c7e571c 100644 --- a/classes/class.content_allocation_article.php +++ b/classes/class.content_allocation_article.php @@ -103,7 +103,7 @@ class pApiContentAllocationArticle extends pApiTree { $this->tpl->next(); } - $this->tpl->set('s', "CATEGORY", i18n("Category", "cl-content-allocation")); + $this->tpl->set('s', "CATEGORY", i18n("Category", "content_allocation")); if ($return === true) { return $this->tpl->generate($this->template, true); diff --git a/classes/class.content_allocation_treeview.php b/classes/class.content_allocation_treeview.php index 9962a06..517a54f 100644 --- a/classes/class.content_allocation_treeview.php +++ b/classes/class.content_allocation_treeview.php @@ -96,7 +96,7 @@ class pApiContentAllocationTreeView extends pApiTree { controller.focus(); function fieldCheck() { if (controller.value == "") { - alert("' . i18n("Please enter a category name", "cl-content-allocation") . '"); + alert("' . i18n("Please enter a category name", "content_allocation") . '"); controller.focus(); return false; } @@ -120,23 +120,23 @@ class pApiContentAllocationTreeView extends pApiTree { } $item['ITEMINDENT'] = $item_tmp['level'] * 15 + 3; - $item['ACTION_CREATE'] = '' . i18n('; + $item['ACTION_CREATE'] = '' . i18n('; - $item['ACTION_RENAME'] = '' . i18n('; - $item['ACTION_MOVE_UP'] = (count($result) >= 1) ? '' . i18n(' : ''; - $item['ACTION_MOVE_DOWN'] = (count($result) >= 1) ? '' . i18n(' : ''; + $item['ACTION_RENAME'] = '' . i18n('; + $item['ACTION_MOVE_UP'] = (count($result) >= 1) ? '' . i18n(' : ''; + $item['ACTION_MOVE_DOWN'] = (count($result) >= 1) ? '' . i18n(' : ''; $item['ACTION_MOVE_DOWN'] = ''; if ($item_tmp['online'] == 1) { // set offline - $item['ACTION_ONOFFLINE'] = '' . i18n('; + $item['ACTION_ONOFFLINE'] = '' . i18n('; } else { - $item['ACTION_ONOFFLINE'] = '' . i18n('; + $item['ACTION_ONOFFLINE'] = '' . i18n('; } if ($item_tmp['children']) { - $item['ACTION_DELETE'] = '' . i18n('; + $item['ACTION_DELETE'] = '' . i18n('; } else { - $item['ACTION_DELETE'] = '
' . str_replace("'", "\'", $item_tmp['name']) . '","deleteCategory(' . $item_tmp['idpica_alloc'] . ')");">' . i18n(
'; + $item['ACTION_DELETE'] = '
' . str_replace("'", "\'", $item_tmp['name']) . '","deleteCategory(' . $item_tmp['idpica_alloc'] . ')");">' . i18n(
'; } array_push($result, $item); @@ -172,7 +172,7 @@ class pApiContentAllocationTreeView extends pApiTree { controller.focus(); function fieldCheck() { if (controller.value == "") { - alert("' . i18n("Please enter a category name", "cl-content-allocation") . '"); + alert("' . i18n("Please enter a category name", "content_allocation") . '"); controller.focus(); return false; } @@ -219,8 +219,8 @@ class pApiContentAllocationTreeView extends pApiTree { $this->tpl->next(); } - $this->tpl->set('s', 'CATEGORY', i18n("Category", "cl-content-allocation")); - $this->tpl->set('s', 'ACTIONS', i18n("Actions", "cl-content-allocation")); + $this->tpl->set('s', 'CATEGORY', i18n("Category", "content_allocation")); + $this->tpl->set('s', 'ACTIONS', i18n("Actions", "content_allocation")); if ($return === true) { return $this->tpl->generate($this->template, true); diff --git a/includes/config.autoloader.php b/includes/config.autoloader.php index 35e2e67..efcd0cf 100644 --- a/includes/config.autoloader.php +++ b/includes/config.autoloader.php @@ -18,7 +18,7 @@ if(!defined('CON_FRAMEWORK')) { die('Illegal call'); } -$sAutoloadClassPath = 'conlite/plugins/cl-content-allocation/classes/'; +$sAutoloadClassPath = 'conlite/plugins/content_allocation/classes/'; return array( 'pApiContentAllocation' => $sAutoloadClassPath.'class.content_allocation.php', 'pApiContentAllocationArticle' => $sAutoloadClassPath.'class.content_allocation_article.php', diff --git a/includes/config.plugin.php b/includes/config.plugin.php index 5eed995..40ec70b 100644 --- a/includes/config.plugin.php +++ b/includes/config.plugin.php @@ -32,6 +32,14 @@ if(!defined('CON_FRAMEWORK')) { die('Illegal call'); } + +// plugin includes +plugin_include('content_allocation', 'classes/class.content_allocation_tree.php'); +plugin_include('content_allocation', 'classes/class.content_allocation_treeview.php'); +plugin_include('content_allocation', 'classes/class.content_allocation_article.php'); +plugin_include('content_allocation', 'classes/class.content_allocation.php'); +plugin_include('content_allocation', 'classes/class.content_allocation_complexlist.php'); + // plugin_variables $cfg['tab']['pica_alloc'] = $cfg['sql']['sqlprefix'].'_pica_alloc'; $cfg['tab']['pica_alloc_con'] = $cfg['sql']['sqlprefix'].'_pica_alloc_con'; @@ -39,18 +47,18 @@ $cfg['tab']['pica_lang'] = $cfg['sql']['sqlprefix'].'_pica_lang'; $cfg['pica']['logpath'] = $cfg['path']['contenido'] . $cfg['path']['plugins'] . 'repository/log/data/'; $cfg['pica']['loglevel'] = 'warn'; -$cfg['pica']['treetemplate'] = $cfg['path']['contenido'] . $cfg['path']['plugins'] . 'cl-content-allocation/templates/template.tree_structure.html'; -$cfg['pica']['treetemplate_article'] = $cfg['path']['contenido'] . $cfg['path']['plugins'] . 'cl-content-allocation/templates/template.tree_article.html'; -$cfg['pica']['treetemplate_complexlist'] = $cfg['path']['contenido'] . $cfg['path']['plugins'] . 'cl-content-allocation/templates/template.tree_complexlist.html'; +$cfg['pica']['treetemplate'] = $cfg['path']['contenido'] . $cfg['path']['plugins'] . 'content_allocation/templates/template.tree_structure.html'; +$cfg['pica']['treetemplate_article'] = $cfg['path']['contenido'] . $cfg['path']['plugins'] . 'content_allocation/templates/template.tree_article.html'; +$cfg['pica']['treetemplate_complexlist'] = $cfg['path']['contenido'] . $cfg['path']['plugins'] . 'content_allocation/templates/template.tree_complexlist.html'; -$cfg['pica']['style_complexlist'] = $cfg['path']['contenido_fullhtml'] . $cfg['path']['plugins'] . 'cl-content-allocation/style/complexlist.css'; -$cfg['pica']['script_complexlist'] = $cfg['path']['contenido_fullhtml'] . $cfg['path']['plugins'] . 'cl-content-allocation/scripts/complexlist.js'; +$cfg['pica']['style_complexlist'] = $cfg['path']['contenido_fullhtml'] . $cfg['path']['plugins'] . 'content_allocation/style/complexlist.css'; +$cfg['pica']['script_complexlist'] = $cfg['path']['contenido_fullhtml'] . $cfg['path']['plugins'] . 'content_allocation/scripts/complexlist.js'; // administration > users > area translations global $lngAct, $_cecRegistry; -$lngAct['con_contentallocation']['storeallocation'] = i18n("Store content allocations", "cl-content-allocation"); +$lngAct['con_contentallocation']['storeallocation'] = i18n("Store content allocations", "content_allocation"); -plugin_include('cl-content-allocation', 'includes/functions.chains.php'); +plugin_include('content_allocation', 'includes/functions.chains.php'); $_cecRegistry->addChainFunction("Contenido.Article.RegisterCustomTab", "pica_RegisterCustomTab"); $_cecRegistry->addChainFunction("Contenido.Article.GetCustomTabProperties", "pica_GetCustomTabProperties"); diff --git a/includes/functions.chains.php b/includes/functions.chains.php index 93bbd11..12c1486 100644 --- a/includes/functions.chains.php +++ b/includes/functions.chains.php @@ -58,7 +58,7 @@ function pica_RenderArticleAction ($idcat, $idart, $idartlang, $actionkey) if ($actionkey == "con_contentallocation") { - return ''; + return ''; } else { return ""; diff --git a/includes/include.contentallocation_article.php b/includes/include.contentallocation_article.php index 4b478b5..4fbda48 100644 --- a/includes/include.contentallocation_article.php +++ b/includes/include.contentallocation_article.php @@ -36,7 +36,7 @@ if (!defined('CON_FRAMEWORK')) { Contenido_Security::checkRequests(); if (!($perm->have_perm_area_action($area, "storeallocation") || $perm->have_perm_area_action_item($area, "storeallocation", $idcat))) { - $notification->displayNotification("error", i18n("Permission denied", "cl-content-allocation")); + $notification->displayNotification("error", i18n("Permission denied", "content_allocation")); return; } @@ -89,7 +89,7 @@ $oTree->setChecked($loadedAllocations); $result = $oTree->renderTree(true); if ($result == false) { - $result = $notification->returnNotification("warning", i18n('There is no Content Allocation tree.', "cl-content-allocation")); + $result = $notification->returnNotification("warning", i18n('There is no Content Allocation tree.', "content_allocation")); } else { if (!is_object($tpl)) { $tpl = new Template; @@ -116,8 +116,8 @@ if ($result == false) { $tpl->set('s', 'TREE', $result); - $tpl->set('s', 'REMOVE_ALL', i18n("Remove all", "cl-content-allocation")); - $tpl->set('s', 'REMOVE', i18n("Remove", "cl-content-allocation")); + $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); diff --git a/includes/include.right_bottom.php b/includes/include.right_bottom.php index 78fe39c..06a5c35 100644 --- a/includes/include.right_bottom.php +++ b/includes/include.right_bottom.php @@ -67,7 +67,7 @@ $oTree = new pApiContentAllocationTreeView('f7771624-4874-4745-8b7e-21a49a71a447 // store item if ($_POST['step'] == 'store') { $pNotify = '
'; - $sMessage = sprintf(i18n("New Category %s successfully stored!", "cl-content-allocation"), $treeItem['name']); + $sMessage = sprintf(i18n("New Category %s successfully stored!", "content_allocation"), $treeItem['name']); $notification->displayNotification("info", $sMessage); $pNotify .= '
'; $oTree->storeItem($aPostTreeItem); @@ -75,7 +75,7 @@ if ($_POST['step'] == 'store') { // rename item if ($_POST['step'] == 'storeRename') { $pNotify = '
'; - $sMessage = sprintf(i18n("Category %s successfully renamed!", "cl-content-allocation"), $treeItem['name']); + $sMessage = sprintf(i18n("Category %s successfully renamed!", "content_allocation"), $treeItem['name']); $notification->displayNotification("info", $sMessage); $pNotify .= '
'; $oTree->storeItem($aPostTreeItem); @@ -87,7 +87,7 @@ if ($_GET['step'] == 'moveup') { if ($_GET['step'] == 'deleteItem') { // delete item $pNotify = '
'; - $sMessage = i18n("Category successfully deleted!", "cl-content-allocation"); + $sMessage = i18n("Category successfully deleted!", "content_allocation"); $notification->displayNotification("info", $sMessage); $pNotify .= '
'; $oTree->deleteItem($_GET['idpica_alloc']); @@ -116,7 +116,7 @@ if ($_GET['step'] == 'createRoot') { // create new root item - ' . i18n("Create new tree", "cl-content-allocation") . ' + ' . i18n("Create new tree", "content_allocation") . '   @@ -129,7 +129,7 @@ if ($_GET['step'] == 'createRoot') { // create new root item controller.focus(); function fieldCheck() { if (controller.value == "") { - alert("' . i18n("Please enter a category name.", "cl-content-allocation") . '"); + alert("' . i18n("Please enter a category name.", "content_allocation") . '"); controller.focus(); return false; } @@ -139,7 +139,7 @@ if ($_GET['step'] == 'createRoot') { // create new root item $oDiv->setContent($form); $sTemp = $oDiv->render(); } else { - $newTree = '' . i18n("Create new tree", "cl-content-allocation") . '
'; + $newTree = '' . i18n("Create new tree", "content_allocation") . '
'; } $result = $oTree->renderTree(true); diff --git a/locale/cl-content-allocation.pot b/locale/content_allocation.pot similarity index 100% rename from locale/cl-content-allocation.pot rename to locale/content_allocation.pot diff --git a/locale/de_DE/LC_MESSAGES/cl-content-allocation.mo b/locale/de_DE/LC_MESSAGES/content_allocation.mo similarity index 100% rename from locale/de_DE/LC_MESSAGES/cl-content-allocation.mo rename to locale/de_DE/LC_MESSAGES/content_allocation.mo diff --git a/locale/de_DE/LC_MESSAGES/cl-content-allocation.po b/locale/de_DE/LC_MESSAGES/content_allocation.po similarity index 100% rename from locale/de_DE/LC_MESSAGES/cl-content-allocation.po rename to locale/de_DE/LC_MESSAGES/content_allocation.po diff --git a/plugin_install.sql b/plugin_install.sql deleted file mode 100644 index 2a38c3e..0000000 --- a/plugin_install.sql +++ /dev/null @@ -1,30 +0,0 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ -/** - * Author: oldperl - * Created: 06.05.2021 - */ - -CREATE TABLE `!PREFIX!ca_alloc` ( - `idpica_alloc` int(10) NOT NULL DEFAULT 0, - `parentid` int(10) DEFAULT NULL, - `sortorder` int(10) NOT NULL DEFAULT 0, -PRIMARY KEY (`idpica_alloc`) -); - -CREATE TABLE `!PREFIX!ca_alloc_con` ( - `idpica_alloc` int(10) NOT NULL DEFAULT 0, - `idartlang` int(10) NOT NULL DEFAULT 0, -PRIMARY KEY (`idpica_alloc`) -); - -CREATE TABLE `!PREFIX!ca_lang` ( - `idpica_alloc` int(10) NOT NULL DEFAULT 0, - `idlang` int(10) NOT NULL DEFAULT 0, - `name` varchar(255) DEFAULT NULL, - `online` tinyint(1) NOT NULL DEFAULT 0, -PRIMARY KEY (`idpica_alloc`) -); \ No newline at end of file diff --git a/plugin_uninstall.sql b/plugin_uninstall.sql deleted file mode 100644 index 321da65..0000000 --- a/plugin_uninstall.sql +++ /dev/null @@ -1,13 +0,0 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ -/** - * Author: oldperl - * Created: 06.05.2021 - */ - -DROP TABLE IF EXISTS !PREFIX!ca_alloc; -DROP TABLE IF EXISTS !PREFIX!ca_alloc_con; -DROP TABLE IF EXISTS !PREFIX!ca_lang; \ No newline at end of file diff --git a/xml/content_allocation.xml b/xml/content_allocation.xml new file mode 100644 index 0000000..59f1e3b --- /dev/null +++ b/xml/content_allocation.xml @@ -0,0 +1,12 @@ + + +
Content Allocation
+ + + + +
+ Content Allocation +
+
+
\ No newline at end of file diff --git a/xml/lang_de_DE.xml b/xml/lang_de_DE.xml index 960aba4..eb8c1f2 100644 --- a/xml/lang_de_DE.xml +++ b/xml/lang_de_DE.xml @@ -1,15 +1,11 @@ - - - -
Tagging
-
-
- -
- Tagging -
-
+ + + +
Content Allocation
+
+
+
\ No newline at end of file diff --git a/xml/lang_en_EN.xml b/xml/lang_en_EN.xml index 92e89e4..eb8c1f2 100644 --- a/xml/lang_en_EN.xml +++ b/xml/lang_en_EN.xml @@ -1,16 +1,11 @@ - - - -
Tagging
-
-
- -
- Tagging -
-
-
+ + + +
Content Allocation
+
+
+
\ No newline at end of file diff --git a/xml/lang_en_US.xml b/xml/lang_en_US.xml index 92e89e4..eb8c1f2 100644 --- a/xml/lang_en_US.xml +++ b/xml/lang_en_US.xml @@ -1,16 +1,11 @@ - - - -
Tagging
-
-
- -
- Tagging -
-
-
+ + + +
Content Allocation
+
+
+
\ No newline at end of file