diff --git a/fp-includes/core/function.list_categories.php b/fp-includes/core/function.list_categories.php
deleted file mode 100644
index 2353e13..0000000
--- a/fp-includes/core/function.list_categories.php
+++ /dev/null
@@ -1,157 +0,0 @@
-'
','ird'=>"\n",
- 'old'=>"\n",
- 'name' => isset($params['name'])? $params['name'] : '',
- 'selected' => array()
- );
-
- $cat_params = array_merge($cat_params, $params);
-
- // makese 'selected' an arr
- $cat_params['selected'] = (array)$params['selected'];
-
- //echo "" . print_r(entry_categories_get()) . "
";
-
- if (file_exists(CONTENT_DIR . 'categories.txt')) {
- $cats = trim(io_load_file(CONTENT_DIR . 'categories.txt'));
- $stack=array(0);
- $arr=array();
-
- $line36error = explode("\n", $cats);
- $line35error = ''.do_print_categories_list($line36error, $stack, $arr, $cat_params).'
';
-
- return $line35error;
- } else {
- global $lang;
-
- $content = 'Unfiled';
- if (isset($lang['admin']['entry']['publish']['nocategories']))
- $content = $lang['admin']['entry']['publish']['nocategories'];
- return '' ;
- }
-
- //
-
-}
-
-
-
-
-
-function do_print_categories_list(&$lines, &$indentstack, &$result, $params) {
-
- global $smarty, $fpdb;
-
- extract($params);
-
- if (empty($lines)) {
- $l = count($indentstack)-1;
- if ($l > 0)
- $arr = array_fill(0, $l, $ord.$ird);
- else
- $arr = array();
-
- $result = array_merge($result, $arr);
- return '';
- }
-
-
- $str = '';
- $v = reset($lines);
- $vt = ltrim($v);
-
- $indent = utils_countdashes($vt, $text);
- $indent_old = end($indentstack);
-
- $val = explode(':', $text);
- $vt = $val[0];
- $vid = trim($val[1]);
-
- $catname = $params['name'];
-
- if ($indent > $indent_old) {
- array_push($indentstack, $indent);
-
- array_pop($result);
- array_push($result, $old);
- //array_push($result, $ild);
- do_print_categories_list($lines, $indentstack, $result, $params);
- }elseif($indent < $indent_old) {
- array_pop($indentstack);
-
- array_push($result, $ord);
- array_push($result, $ird);
-
- do_print_categories_list($lines, $indentstack, $result, $params);
- }else{
- array_push($result, $ild);
-
-
- $cat_entry = $params['selected'];
-
- if (isset($params['type']) && ($params['type']=='form' || $params['type']=='check')) {
- $string = '';
- $after = $string;
- }elseif(isset($params['type']) && $params['type']=='linked'){
- $after='';
- if (isset($params['count']) && $params['count']) {
- $index =& $fpdb->get_index($vid);
- $count = ($index)? $index->length() : 0;
- $after = " ($count) ". $after;
- }
- }
-
- array_push($result, $after);
-
- array_push($result, $ird);
- array_shift($lines);
- do_print_categories_list($lines, $indentstack, $result, $params);
- }
-
- return implode($result);
-
-}
diff --git a/fp-includes/smarty-4.0.4/libs/plugins/function.list_categories.php b/fp-includes/smarty-4.0.4/libs/plugins/function.list_categories.php
new file mode 100644
index 0000000..507c369
--- /dev/null
+++ b/fp-includes/smarty-4.0.4/libs/plugins/function.list_categories.php
@@ -0,0 +1,155 @@
+ '',
+ 'ird' => "\n",
+ 'old' => "\n",
+ 'name' => isset($params ['name']) ? $params ['name'] : '',
+ 'selected' => array()
+ );
+
+ $cat_params = array_merge($cat_params, $params);
+
+ // makese 'selected' an arr
+ $cat_params ['selected'] = array_key_exists('selected', $params) ? (array) $params ['selected'] : false;
+
+ // echo "" . print_r(entry_categories_get()) . "
";
+
+ if (file_exists(CONTENT_DIR . 'categories.txt')) {
+ $cats = trim(io_load_file(CONTENT_DIR . 'categories.txt'));
+ $stack = array(
+ 0
+ );
+ $arr = array();
+
+ $line36error = explode("\n", $cats);
+ $line35error = '' . do_print_categories_list($line36error, $stack, $arr, $cat_params) . '
';
+
+ return $line35error;
+ } else {
+ global $lang;
+
+ $content = 'Unfiled';
+ if (isset($lang ['admin'] ['entry'] ['publish'] ['nocategories']))
+ $content = $lang ['admin'] ['entry'] ['publish'] ['nocategories'];
+ return '';
+ }
+
+ //
+}
+
+function do_print_categories_list(&$lines, &$indentstack, &$result, $params) {
+ global $smarty, $fpdb;
+
+ extract($params);
+
+ if (empty($lines)) {
+ $l = count($indentstack) - 1;
+ if ($l > 0)
+ $arr = array_fill(0, $l, $ord . $ird);
+ else
+ $arr = array();
+
+ $result = array_merge($result, $arr);
+ return '';
+ }
+
+ $str = '';
+ $v = reset($lines);
+ $vt = ltrim($v);
+
+ $indent = utils_countdashes($vt, $text);
+ $indent_old = end($indentstack);
+
+ $val = explode(':', $text);
+ $vt = $val [0];
+ $vid = trim($val [1]);
+
+ $catname = $params ['name'];
+
+ if ($indent > $indent_old) {
+ array_push($indentstack, $indent);
+
+ array_pop($result);
+ array_push($result, $old);
+ // array_push($result, $ild);
+ do_print_categories_list($lines, $indentstack, $result, $params);
+ } elseif ($indent < $indent_old) {
+ array_pop($indentstack);
+
+ array_push($result, $ord);
+ array_push($result, $ird);
+
+ do_print_categories_list($lines, $indentstack, $result, $params);
+ } else {
+ array_push($result, $ild);
+
+ $cat_entry = $params ['selected'];
+
+ if (isset($params ['type']) && ($params ['type'] == 'form' || $params ['type'] == 'check')) {
+ $string = '';
+ $after = $string;
+ } elseif (isset($params ['type']) && $params ['type'] == 'linked') {
+ $after = '';
+ if (isset($params ['count']) && $params ['count']) {
+ $index = & $fpdb->get_index($vid);
+ $count = ($index) ? $index->length() : 0;
+ $after = " ($count) " . $after;
+ }
+ }
+
+ array_push($result, $after);
+
+ array_push($result, $ird);
+ array_shift($lines);
+ do_print_categories_list($lines, $indentstack, $result, $params);
+ }
+
+ return implode($result);
+}
diff --git a/fp-includes/smarty-4.0.4/libs/plugins/resource.plugin.php b/fp-includes/smarty-4.0.4/libs/plugins/resource.plugin.php
index a4cf20c..696db39 100644
--- a/fp-includes/smarty-4.0.4/libs/plugins/resource.plugin.php
+++ b/fp-includes/smarty-4.0.4/libs/plugins/resource.plugin.php
@@ -1,54 +1,74 @@
PLUGINS_DIR/plugin.PLUGINNAME/PLUGINFILE
- * -------------------------------------------------------------
+
+/**
+ * Resoure plugin that conveniently allows to include templates from the plugin templates folder via {include file="plugin:example.tpl"}
+ *
+ * @author FlatPress
+ * @see https://www.smarty.net/docs/en/plugins.resources.tpl
*/
-
+class Smarty_Resource_Plugin extends Smarty_Resource_Custom {
-function smarty_resource_plugin_parsename($tpl_name) {
- $path = null;
-
- $f=explode('/',$tpl_name);
- $path = ABS_PATH . PLUGINS_DIR . "{$f[0]}/tpls/{$f[1]}.tpl";
-
- return $path;
-
-}
+ /**
+ *
+ * {@inheritdoc}
+ * @see Smarty_Resource_Custom::fetch()
+ */
+ protected function fetch($name, &$source, &$mtime) {
+ $filePath = $this->getFilePath($name);
-function smarty_resource_plugin_source($tpl_name, &$tpl_source, &$smarty)
-{
- $fname = smarty_resource_plugin_parsename($tpl_name);
- if ($tpl_source = io_load_file($fname)) {
- return true;
- } else {
- return false;
+ if ($source = io_load_file($filePath)) {
+ $mtime = filemtime($filePath);
+ } else {
+ $source = null;
+ $mtime = null;
+ }
}
+
+ private function getFilePath($templateName) {
+ $path = null;
+
+ $f = explode('/', $templateName);
+ $path = ABS_PATH . PLUGINS_DIR . "{$f[0]}/tpls/{$f[1]}.tpl";
+
+ return $path;
+ }
+
}
-function smarty_resource_plugin_timestamp($tpl_name, &$tpl_timestamp, &$smarty)
-{
- $fname = smarty_resource_plugin_parsename($tpl_name);
- if (file_exists($fname)) {
- $tpl_timestamp = filemtime($fname);
- return true;
- } else {
- return false;
- }
-}
+// /*
+// * Smarty plugin
+// * -------------------------------------------------------------
+// * File: resource.plugin.php
+// * Type: plugin tpls
+// * Name: plugin
+// * Purpose: convenient way to call stored tpls in PLUGINS_DIR
+// * Use: plugin:PLUGINNAME/PLUGINFILE realpath=> PLUGINS_DIR/plugin.PLUGINNAME/PLUGINFILE
+// * -------------------------------------------------------------
+// */
+// function smarty_resource_plugin_parsename($tpl_name) {
+// $path = null;
-function smarty_resource_plugin_secure($tpl_name, &$smarty)
-{
- return true;
-}
+// $f = explode('/', $tpl_name);
+// $path = ABS_PATH . PLUGINS_DIR . "{$f[0]}/tpls/{$f[1]}.tpl";
-function smarty_resource_plugin_trusted($tpl_name, &$smarty)
-{
-
-}
-?>
+// return $path;
+// }
+
+// function smarty_resource_plugin_source($tpl_name, &$tpl_source, &$smarty) {
+// $fname = smarty_resource_plugin_parsename($tpl_name);
+// if ($tpl_source = io_load_file($fname)) {
+// return true;
+// } else {
+// return false;
+// }
+// }
+
+// function smarty_resource_plugin_timestamp($tpl_name, &$tpl_timestamp, &$smarty) {
+// $fname = smarty_resource_plugin_parsename($tpl_name);
+// if (file_exists($fname)) {
+// $tpl_timestamp = filemtime($fname);
+// return true;
+// } else {
+// return false;
+// }
+// }
diff --git a/fp-includes/smarty-4.0.4/libs/plugins/resource.shared.php b/fp-includes/smarty-4.0.4/libs/plugins/resource.shared.php
index b722118..f8b69c0 100644
--- a/fp-includes/smarty-4.0.4/libs/plugins/resource.shared.php
+++ b/fp-includes/smarty-4.0.4/libs/plugins/resource.shared.php
@@ -1,39 +1,25 @@
+}
\ No newline at end of file