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
* Lists Information and Credits for all User Modules.
* @return HTML output string
$pnRender->cache_id = $cacheid;
// check out if the contents are cached.
// If this is the case, we do not need to make DB queries.
if ($pnRender->is_cached('credits_user_main.htm')) {
return $pnRender->fetch('credits_user_main.htm');
// define array of filetypes for future use
// If the user is site admin then get all modules including admin only modules
foreach ($modules as $key => $module) {
if ($module['type'] == 3) {
foreach ($filetypes as $filetype) {
if (!file_exists($rootdir. $osmoddir. '/'. $module[$filetype])) {
$modules[$key][$filetype] = '';
// explode the contact and author arrays to allow for
// multiple authors and contacts
$modules[$key]['author'] = explode(',', $module['author']);
$modules[$key]['contact'] = explode(',', $module['contact']);
// check if an e-mail address is given as the contact
foreach($modules[$key]['contact'] as $contactid => $contact) {
$contact = trim($contact);
if (eregi ("^([a-z0-9_]|\\-|\\.)+@(([a-z0-9_]|\\-)+\\.)+[a-z]{2,4}$", $contact)) {
$modules[$key]['contact'][$contactid] = 'mailto:' . $contact;
foreach ($themes as $key => $theme) {
// check that the actual files exist
foreach ($filetypes as $filetype) {
if (!file_exists('themes/'. $osthemedir. '/'. $theme[$filetype])) {
$themes[$key][$filetype] = '';
// explode the contact and author arrays to allow for
// multiple authors and contacts
$themes[$key]['author'] = explode(',', $theme['author']);
$themes[$key]['contact'] = explode(',', $theme['contact']);
// check if an e-mail address is given as the contact
foreach($themes[$key]['contact'] as $contactid => $contact) {
$contact = trim($contact);
if (eregi ("^([a-z0-9_]|\\-|\\.)+@(([a-z0-9_]|\\-)+\\.)+[a-z]{2,4}$", $contact)) {
$themes[$key]['contact'][$contactid] = 'mailto:' . $contact;
// highly unlikely but check if we have no modules returned
// assign content to user
$pnRender->assign('modules', $modules);
$pnRender->assign('themes', $themes);
return $pnRender->fetch('credits_user_main.htm');
* Displays modules documentation
* @return HTML output string
$filetype = (string) FormUtil::getPassedValue('filetype', isset ($args['filetype']) ? $args['filetype'] : null, 'GET');
// work out the version number, the display name for the module (or core)
// and the directory(ies) to locate the files
$modinfo['name'] = 'core';
$modinfo['directory'] = 'core';
$pnRender->cache_id = md5($modinfo['directory']. $filetype);
// check out if the contents are cached.
// If this is the case, we do not need to make DB queries.
if ($pnRender->is_cached('credits_user_display.htm')) {
return $pnRender->fetch('credits_user_display.htm');
// now lets locate the module version info
$filename = 'docs/CREDITS.txt';
$filename = 'docs/COPYING.txt';
if ($modinfo['type'] == 3) {
// assign the values to the template
$pnRender->assign($modinfo);
$pnRender->assign('thefile', $thefile);
$pnRender->assign('filetype', $filetype);
// create a fake numeric item id to allow display hooks work properly
$pnRender->assign('itemid', $pnRender->cache_id);
return $pnRender->fetch('credits_user_display.htm');
|