]> git.mjollnir.org Git - s9y.git/commitdiff
Allow recent entries plugin to fixat "current" category
authorgarvinhicking <garvinhicking>
Tue, 9 Oct 2007 13:33:23 +0000 (13:33 +0000)
committergarvinhicking <garvinhicking>
Tue, 9 Oct 2007 13:33:23 +0000 (13:33 +0000)
include/admin/images.inc.php
plugins/serendipity_plugin_recententries/serendipity_plugin_recententries.php

index 056be04fd87574c76c0d0b6569bea301038633a0..199ad27fee5491a4ea1b0319af33216ce58a1246 100644 (file)
@@ -498,6 +498,8 @@ switch ($serendipity['GET']['adminAction']) {
         $new_dir = serendipity_uploadSecure($serendipity['POST']['parent'] . '/' . $serendipity['POST']['name'], true);
         $new_dir = str_replace(array('..', '//'), array('', '/'), $new_dir);
 
+        serendipity_plugin_api::hook_event('backend_directory_create', $serendipity['serendipityPath'] . $serendipity['uploadPath'] . $new_dir);
+
         /* TODO: check if directory already exist */
         if (@mkdir($serendipity['serendipityPath'] . $serendipity['uploadPath'] . $new_dir)) {
             printf(DIRECTORY_CREATED, $serendipity['POST']['name']);
index f815831c7693344f9cf371f90bfdac7200ea05d7..6aa594370044a7709c91d0d8042ebcb31c6f518d 100644 (file)
@@ -21,7 +21,7 @@ class serendipity_plugin_recententries extends serendipity_plugin {
         $propbag->add('description',   PLUGIN_RECENTENTRIES_BLAHBLAH);
         $propbag->add('stackable',     true);
         $propbag->add('author',        'Christian Machmeier, Christian Brabandt');
-        $propbag->add('version',       '1.7');
+        $propbag->add('version',       '1.8');
         $propbag->add('requirements',  array(
             'serendipity' => '0.8',
             'smarty'      => '2.6.7',
@@ -92,6 +92,7 @@ class serendipity_plugin_recententries extends serendipity_plugin {
 
                 $select_cats = array();
                 $select_cats['none'] = ALL_CATEGORIES;
+                $select_cats['_cur'] = PARENT_CATEGORY;
                 foreach($tmp_select_cats as $cidx => $tmp_select_cat) {
                     $select_cat = explode('|||', $tmp_select_cat);
                     if (!empty($select_cat[0]) && !empty($select_cat[1])) {
@@ -119,6 +120,10 @@ class serendipity_plugin_recententries extends serendipity_plugin {
         $number         = $this->get_config('number');
         $dateformat     = $this->get_config('dateformat');
         $category       = $this->get_config('category', 'none');
+        
+        if ($category == '_cur') {
+            $category = $serendipity['GET']['category'];
+        }
         $title          = $this->get_config('title', $this->title);
         $number_from_sw = $this->get_config('number_from');
         $randomize      = ($this->get_config('randomize') == "yes") ? true : false ;