Source for file pnuser.php
Documentation is available at pnuser.php
* Zikula Application Framework
* @copyright (c) 2002, Zikula Development Team
* @link http://www.zikula.org
* @version $Id: pnuser.php 24342 2008-06-06 12:03:14Z markwest $
* @license GNU/GPL - http://www.gnu.org/copyleft/gpl.html
* @package Zikula_Value_Addons
* This function is the default function, and is called whenever the module is
* initiated without defining arguments. As such it can be used for a number
* of things, but most commonly it either just shows the module menu and
* returns or calls whatever the module designer feels should be the default
* function (often this is the view() function)
$enablecategorization = pnModGetVar('Feeds', 'enablecategorization');
if ($enablecategorization) {
pn_exit (pnML('_UNABLETOLOADCLASS', array('s' => 'CategoryRegistryUtil')));
// get the categories registered for the Pages
// Assign some useful vars to customize the main
$pnRender->assign('properties', $properties);
// Assign the module vars
$pnRender->assign('enablecategorization', $enablecategorization);
// Return the output that has been generated by this function
return $pnRender->fetch('feeds_user_main.htm');
* This is a standard function to provide an overview of all of the items
* available from the module.
// Get parameters from whatever input we need.
$startnum = (int) FormUtil::getPassedValue('startnum', isset ($args['startnum']) ? $args['startnum'] : 1, 'GET');
// defaults and input validation
// get all module vars for later use
// check if categorisation is enabled
if ($modvars['enablecategorization']) {
pn_exit (pnML('_UNABLETOLOADCLASS', array('s' => 'CategoryUtil || CategoryRegistryUtil')));
// get the categories registered for the Pages
if (empty($prop) || !in_array($prop, $props)) {
// if the property and the category are specified
// means that we'll list the feeds that belongs to that category
if (!empty($cat) && isset ($cat['path'])) {
// include all it's subcategories and build the filter
$categories = categoryUtil::getCategoriesByPath($cat['path'], '', 'path');
foreach ($categories as $category) {
$catstofilter[] = $category['id'];
$catFilter = array($prop => $catstofilter);
// if nothing or only property is specified
// means that we'll list the subcategories available on that property
$rootCat['path'] .= '/'; // add this to make the relative paths of the subcategories with ease
if (!isset ($catFilter) && $modvars['enablecategorization']) {
//Assign the action to perform
$pnRender->assign('action', 'subcatslist');
// Assign the data to display
$pnRender->assign('rootCat', $rootCat);
$pnRender->assign('property', $prop);
$pnRender->assign('categories', $categories);
// of an specific category if enabledcategorization
//Assign the action to perform
$pnRender->assign('action', 'feedslist');
if ($modvars['enablecategorization']) {
// Assign the data to display
$pnRender->assign('category', $cat);
// Get all matching feeds
array('startnum' => $startnum,
'numitems' => $modvars['itemsperpage'],
'category' => isset ($catFilter) ? $catFilter : null,
'catregistry' => isset ($catregistry) ? $catregistry : null));
// assign the values for the smarty plugin to produce a pager
$pnRender->assign('pager', array('numitems' => pnModAPIFunc('Feeds', 'user', 'countitems', array('category' => isset ($catFilter) ? $catFilter : null)),
'itemsperpage' => $modvars['itemsperpage']));
// assign the items to the template
$pnRender->assign('items', $items);
// assign various useful template variables
$pnRender->assign('startnum', $startnum);
$pnRender->assign($modvars);
// Return the output that has been generated by this function
return $pnRender->fetch('feeds_user_view.htm');
* This is a standard function to provide detailed informtion on a single item
* available from the module.
$pnRender->cache_id = $fid;
$pnRender->cache_id = $title;
// check out if the contents are cached.
if ($pnRender->is_cached('feeds_user_display.htm')) {
return $pnRender->fetch('feeds_user_display.htm');
$item = pnModAPIFunc('Feeds', 'user', 'get', array('fid' => $fid));
$item = pnModAPIFunc('Feeds', 'user', 'get', array('title' => $title));
$feed = pnModAPIFunc('Feeds', 'user', 'getfeed', array('fid' => $item['fid']));
// Assign the module vars
// Display details of the item.
$pnRender->assign('item', $item);
$pnRender->assign('feed', $feed);
// Return the output that has been generated by this function
return $pnRender->fetch('feeds_user_display.htm');
|