Source for file pnadminapi.php
Documentation is available at pnadminapi.php
* Zikula Application Framework
* @copyright (c) 2002, Zikula Development Team
* @link http://www.zikula.org
* @version $Id: pnadminapi.php 24342 2008-06-06 12:03:14Z markwest $
* @license GNU/GPL - http://www.gnu.org/copyleft/gpl.html
* @package Zikula_Value_Addons
* @param $args['question'] name of the item
* @param $args['answer'] number of the item
* @param $args['submittedby'] name of the submitter (if anonymous) (optional)
* @param $args['submittedbyid'] id of the submitter (if logged in) (optional)
* @param $args['answeredbyid'] id of the answerer (optional)
* @return mixed FAQ ID on success, false on failure
if (!isset ($faq['question']) ||
!isset ($faq['answer'])) {
if (!isset ($faq['submittedby'])) {
$faq['submittedby'] = '';
if (!isset ($faq['submittedbyid'])) {
if (!isset ($faq['answeredbyid'])) {
if (strlen($faq['answer']) > 0) {
$faq['answeredbyid'] = $faq['submittedbyid'];
$faq['answeredbyid'] = '';
// define the permalink title if not present
if (!isset ($faq['urltitle']) || empty($faq['urltitle'])) {
// Let any hooks know that we have created a new item
pnModCallHooks('item', 'create', $faq['faqid'], array('module' => 'FAQ'));
// Return the id of the newly created item to the calling process
* @param $args['faqid'] ID of the item
* @return bool true on success, false on failure
if (!isset ($args['faqid']) || !is_numeric($args['faqid'])) {
$item = pnModAPIFunc('FAQ', 'user', 'get', array('faqid' => $args['faqid']));
// Let any hooks know that we have deleted an item
pnModCallHooks('item', 'delete', $args['faqid'], array('module' => 'FAQ'));
// The item has been deleted, so we clear all cached pages of this item.
$pnRender->clear_cache(null, $args['faqid']);
* @param $args['faqid'] the ID of the item
* @param $args['question'] the new name of the item
* @param $args['answer'] the new number of the item
* @param $args['submittedby'] name of the submitter (if anonymous)
* @param $args['submittedbyid'] id of the submitter (if logged in)
* @param $args['answeredbyid'] id of the answerer (optional)
* @return bool true on success, false on failure
if (!isset ($faq['question']) ||
!isset ($faq['answer']) ||
!isset ($faq['faqid']) || !is_numeric($faq['faqid'])) {
if (!isset ($faq['answeredbyid'])) {
if (strlen($faq['answer']) > 0) {
$faq['answeredbyid'] = '';
// define the permalink title if not present
if (!isset ($faq['urltitle']) || empty($faq['urltitle'])) {
$item = pnModAPIFunc('FAQ', 'user', 'get', array('faqid' => $faq['faqid']));
// The item has been modified, so we clear all cached pages of this item.
$pnRender->clear_cache(null, $faq['faqid']);
// Let any hooks know that we have updated an item
pnModCallHooks('item', 'update', $faq['faqid'], array('module' => 'FAQ'));
* get available admin panel links
* @return array array of admin links
|