summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorMax Kremmel <xing@synapse.plus.com>2005-10-26 17:46:45 +0000
committerMax Kremmel <xing@synapse.plus.com>2005-10-26 17:46:45 +0000
commitc45773188de5f56953c93043b72e3acc2b2a3b09 (patch)
tree73a4147ef1dacdf48750a7d25ce5e9b6a3a57263 /modules
parent2423f7430299e3312aaf9b201c796b0d085a3d9c (diff)
downloadpigeonholes-c45773188de5f56953c93043b72e3acc2b2a3b09.tar.gz
pigeonholes-c45773188de5f56953c93043b72e3acc2b2a3b09.tar.bz2
pigeonholes-c45773188de5f56953c93043b72e3acc2b2a3b09.zip
new pigeonholes module -> display recent changes restricted to category
Diffstat (limited to 'modules')
-rw-r--r--modules/help_mod_last_changes.tpl33
-rw-r--r--modules/mod_last_changes.php50
-rw-r--r--modules/mod_last_changes.tpl22
-rw-r--r--modules/mod_whats_related.php6
4 files changed, 108 insertions, 3 deletions
diff --git a/modules/help_mod_last_changes.tpl b/modules/help_mod_last_changes.tpl
new file mode 100644
index 0000000..34d1d41
--- /dev/null
+++ b/modules/help_mod_last_changes.tpl
@@ -0,0 +1,33 @@
+{tr}<strong>Summary</strong>: Display the most recently changed content - limited to a given category.{/tr}<br />
+<table class="data">
+ <tr>
+ <th style="width:20%;">{tr}Parameter{/tr}</th>
+ <th style="width:20%;">{tr}Value{/tr}</th>
+ <th style="width:60%;">{tr}Description{/tr}</th>
+ </tr>
+ <tr class="odd">
+ <td>content_type_guid</td>
+ <td>bitpage<br />bituser<br />...</td>
+ <td>{tr}Here you can specify what type of content you wish to show.{/tr}</td>
+ </tr>
+ <tr class="even">
+ <td>show_date</td>
+ <td>( {tr}boolean{/tr} )</td>
+ <td>{tr}Specify if you want to display the date of the last modification.{/tr}</td>
+ </tr>
+ <tr class="odd">
+ <td>hide_content_type</td>
+ <td>( {tr}boolean{/tr} )</td>
+ <td>{tr}Specify if you want to display the content type<br />(only applicable if you don't specify a content_type_guid).{/tr}</td>
+ </tr>
+ <tr class="even">
+ <td>category_id</td>
+ <td>( {tr}numeric{/tr} )</td>
+ <td>{tr}Content ID of the pigeonhole you want to limit the listing to<br />(can be used instead of category).{/tr}</td>
+ </tr>
+ <tr class="odd">
+ <td>category</td>
+ <td>( {tr}string{/tr} )</td>
+ <td>{tr}Title of a category you want to limit the listing to<br />(can be used instead of category_id).{/tr}</td>
+ </tr>
+</table>
diff --git a/modules/mod_last_changes.php b/modules/mod_last_changes.php
new file mode 100644
index 0000000..8f9e23a
--- /dev/null
+++ b/modules/mod_last_changes.php
@@ -0,0 +1,50 @@
+<?php
+// $Header: /cvsroot/bitweaver/_bit_pigeonholes/modules/Attic/mod_last_changes.php,v 1.1 2005/10/26 17:46:45 squareing Exp $
+/**
+ * Params:
+ * - content_type_guid : if set, show only those content_type_guid's
+ * - show_date : if set, show date of last modification
+ * @package liberty
+ * @subpackage modules
+ */
+
+global $gBitUser, $module_rows, $module_params, $gLibertySystem, $module_title;
+
+if( $gBitUser->hasPermission( 'bit_p_view_pigeonholes' ) ) {
+ require_once( PIGEONHOLES_PKG_PATH.'Pigeonholes.php' );
+ $pigeonholes = new Pigeonholes( NULL, NULL, FALSE );
+
+ $listHash = array(
+ 'title' => !empty( $module_params['category'] ) ? $module_params['category'] : NULL,
+ 'content_id' => !empty( $module_params['category_id'] ) ? $module_params['category_id'] : NULL,
+ 'content_type_guid' => !empty( $module_params['content_type_guid'] ) ? $module_params['content_type_guid'] : NULL,
+ 'max_records' => $module_rows,
+ 'sort_mode' => 'last_modified_desc',
+ );
+ $pigeonLastMod = $pigeonholes->getMemberList( $listHash );
+ $gBitSmarty->assign( 'pigeonLastMod', !empty( $pigeonLastMod ) ? $pigeonLastMod : FALSE );
+}
+
+if( empty( $module_title ) ) {
+ if( !empty( $module_params['content_type_guid'] ) && !empty( $gLibertySystem->mContentTypes[$module_params['content_type_guid']] ) ) {
+ $title = tra( "Last Changes" ).': '.tra( $gLibertySystem->mContentTypes[$module_params['content_type_guid']]['content_description'] );
+ $gBitSmarty->assign( 'contentType', $module_params['content_type_guid'] );
+ } else {
+ if( !empty( $module_params['hide_content_type'] ) ) {
+ $gBitSmarty->assign( 'contentType', TRUE );
+ } else {
+ $gBitSmarty->assign( 'contentType', FALSE );
+ }
+
+ $title = tra( "Last Changes" );
+ }
+ $gBitSmarty->assign( 'moduleTitle', $title );
+}
+
+if( !empty( $module_params['show_date'] ) ) {
+ $gBitSmarty->assign( 'showDate' , TRUE );
+}
+
+$modLastContent = $gBitUser->getContentList( $listHash );
+$gBitSmarty->assign_by_ref( 'modLastContent', $modLastContent['data'] );
+?>
diff --git a/modules/mod_last_changes.tpl b/modules/mod_last_changes.tpl
new file mode 100644
index 0000000..a5388c1
--- /dev/null
+++ b/modules/mod_last_changes.tpl
@@ -0,0 +1,22 @@
+{* $Header: /cvsroot/bitweaver/_bit_pigeonholes/modules/Attic/mod_last_changes.tpl,v 1.1 2005/10/26 17:46:45 squareing Exp $ *}
+{strip}
+{if $pigeonLastMod}
+ {bitmodule title="$moduleTitle" name="last_changes"}
+ <ol>
+ {foreach from=$pigeonLastMod item=item}
+ <li>
+ {if !$contentType }
+ <strong>{tr}{$item.content_description}{/tr}: </strong>
+ {/if}
+ {$item.display_link}
+ {if $showDate}
+ <br/><span class="date">{$item.last_modified|bit_short_date}</span>
+ {/if}
+ </li>
+ {foreachelse}
+ <li></li>
+ {/foreach}
+ </ol>
+ {/bitmodule}
+{/if}
+{/strip}
diff --git a/modules/mod_whats_related.php b/modules/mod_whats_related.php
index ceaeb5f..515cc63 100644
--- a/modules/mod_whats_related.php
+++ b/modules/mod_whats_related.php
@@ -1,6 +1,6 @@
<?php
/**
- * $Header: /cvsroot/bitweaver/_bit_pigeonholes/modules/mod_whats_related.php,v 1.1 2005/10/03 09:06:55 squareing Exp $
+ * $Header: /cvsroot/bitweaver/_bit_pigeonholes/modules/mod_whats_related.php,v 1.2 2005/10/26 17:46:45 squareing Exp $
*
* Copyright (c) 2004 bitweaver.org
* Copyright (c) 2003 tikwiki.org
@@ -8,12 +8,12 @@
* All Rights Reserved. See copyright.txt for details and a complete list of authors.
* Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details
*
- * $Id: mod_whats_related.php,v 1.1 2005/10/03 09:06:55 squareing Exp $
+ * $Id: mod_whats_related.php,v 1.2 2005/10/26 17:46:45 squareing Exp $
* @package categories
* @subpackage modules
*/
-global $gQueryUserId, $module_rows, $module_params, $categlib, $gContent;
+global $gContent;
/**
* required setup