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)
* @author The Zikula Development Team
* @return output The main module page
// load the categories system
pn_exit (pnML('_UNABLETOLOADCLASS', array('s' => 'CategoryUtil | CategoryRegistryUtil')));
$categories[$k]['path'] .= '/';
$pnRender->assign('categories', $categories);
// Return the output that has been generated by this function
return $pnRender->fetch('faq_user_main.htm');
* This is a standard function to provide an overview of all of the items
* available from the module.
* @author The Zikula Development Team
* @param integer $startnum (optional) The number of the start item
* @return output The overview page
$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
// and if its requested to list the recent faqs
if ($modvars['enablecategorization'] && !empty($prop) && !empty($cat)) {
pn_exit (pnML('_UNABLETOLOADCLASS', array('s' => 'CategoryUtil | CategoryRegistryUtil')));
// get the categories registered for the Pages
// if the property and the category are specified
// means that we'll list the FAQs 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);
array('startnum' => $startnum,
'numitems' => $modvars['itemsperpage'],
'category' => isset ($catFilter) ? $catFilter : null,
'catregistry' => isset ($catregistry) ? $catregistry : null));
// assign various useful template variables
$pnRender->assign('startnum', $startnum);
$pnRender->assign('category', $cat);
$pnRender->assign('property', $prop);
$pnRender->assign($modvars);
// Loop through each item getting the rendered output from the item template
foreach ($items as $item) {
$pnRender->assign($item);
$faqitems[] = $pnRender->fetch('faq_user_row_read.htm', $item['faqid']);
$pnRender->assign('items', $faqitems);
$pnRender->assign('faqs', $faqs);
$pnRender->assign('func', $func);
// assign the start number
$pnRender->assign('startnum', $startnum);
// assign the values for the smarty plugin to produce a pager
$pnRender->assign('pager', array('numitems' => pnModAPIFunc('FAQ', 'user', 'countitems', array('category' => isset ($catFilter) ? $catFilter : null)),
'itemsperpage' => pnModGetVar('FAQ', 'itemsperpage')));
// Return the output that has been generated by this function
return $pnRender->fetch('faq_user_view.htm');
* This is a standard function to provide detailed informtion on a single item
* available from the module.
* @author The Zikula Development Team
* @param integer $tid the ID of the item to display
* @return output The item detail page
$objectid = FormUtil::getPassedValue('objectid', isset ($args['objectid']) ? $args['objectid'] : null, 'REQUEST');
$pnRender->cache_id = $faqid;
$pnRender->cache_id = $faqid;
// check out if the contents are cached.
if ($pnRender->is_cached('faq_user_display.htm')) {
return $pnRender->fetch('FAQ_user_display.htm');
$item = pnModAPIFunc('FAQ', 'user', 'get', array('faqid' => $faqid));
$item = pnModAPIFunc('FAQ', 'user', 'get', array('title' => $title));
// Assign details of the item.
$pnRender->assign($item);
// Return the output that has been generated by this function
return $pnRender->fetch('faq_user_display.htm');
* @author The Zikula Development Team
* @return output A form to submit a question
// assign logged in state
// Return the output that has been generated by this function
return $pnRender->fetch('faq_user_ask.htm');
* @author The Zikula Development Team
* @param question the question to be submitted
// Get parameters from whatever input we need
// Confirm authorisation code
$faq['submittedby'] = '';
array('question' => $faq['question'],
'submittedby' => $faq['submittedby']));
|