当前位置: 首页>>代码示例>>PHP>>正文


PHP xarML函数代码示例

本文整理汇总了PHP中xarML函数的典型用法代码示例。如果您正苦于以下问题:PHP xarML函数的具体用法?PHP xarML怎么用?PHP xarML使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了xarML函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: calendar_admin_add_event

function calendar_admin_add_event()
{
    // Security check
    if (!xarSecurityCheck('Admincalendar')) {
        return;
    }
    // Generate a one-time authorisation code for this operation
    $data = xarMod::apiFunc('calendar', 'admin', 'get_calendars');
    $data['authid'] = xarSecGenAuthKey();
    $data['default_cal'] = unserialize(xarModVars::get('calendar', 'default_cal'));
    // Variables from phpIcalendar config.inc.php
    $data['updatebutton'] = xarVarPrepForDisplay(xarML('Create event'));
    //TODO: should I include this stuff? --amoro
    /*    $hooks = xarModCallHooks('module', 'modifyconfig', 'calendar',
            array('module' => 'calendar'));
        if (empty($hooks)) {
            $data['hooks'] = '';
        } elseif (is_array($hooks)) {
            $data['hooks'] = join('', $hooks);
        } else {
            $data['hooks'] = $hooks;
        }
    */
    // Return the template variables defined in this function
    return $data;
}
开发者ID:godboko,项目名称:modules,代码行数:26,代码来源:add_event.php

示例2: publications_adminapi_delete

/**
 * Publications Module
 *
 * @package modules
 * @subpackage publications module
 * @category Third Party Xaraya Module
 * @version 2.0.0
 * @copyright (C) 2011 Netspan AG
 * @license GPL {@link http://www.gnu.org/licenses/gpl.html}
 * @author Marc Lutolf <mfl@netspan.ch>
 */
function publications_adminapi_delete($args)
{
    // Get arguments from argument array
    extract($args);
    // Argument check
    if (!isset($itemid)) {
        $msg = xarML('Invalid #(1) for #(2) function #(3)() in module #(4)', 'publication ID', 'admin', 'delete', 'Publications');
        throw new BadParameterException(null, $msg);
    }
    $ids = !is_array($itemid) ? explode(',', $itemid) : $itemid;
    if (!isset($deletetype)) {
        $deletetype = 0;
    }
    sys::import('xaraya.structures.query');
    $table = xarDB::getTables();
    switch ($deletetype) {
        case 0:
        default:
            $q = new Query('UPDATE', $table['publications']);
            $q->addfield('state', 0);
            break;
        case 10:
            $q = new Query('DELETE', $table['publications']);
            break;
    }
    $q->in('id', $ids);
    if (!$q->run()) {
        return false;
    }
    return true;
}
开发者ID:godboko,项目名称:modules,代码行数:42,代码来源:delete.php

示例3: modify

 /**
  * Modify Function to the Blocks Admin
  * @author Jason Judge
  * @param $blockinfo array containing title,content
  */
 public function modify(array $data = array())
 {
     $data = $this->getContent();
     // Get a list of all pages for the drop-downs.
     // Get the tree of all pages, without the DD for speed.
     $data['all_pages'] = xarMod::apiFunc('publications', 'user', 'getpagestree', array('dd_flag' => false, 'key' => 'pid'));
     // Implode the names for each page into a path for display.
     // TODO: move this into getpagestree
     foreach ($data['all_pages']['pages'] as $key => $page) {
         $data['all_pages']['pages'][$key]['slash_separated'] = '/' . implode('/', $page['namepath']);
     }
     // Get the descriptions together for the current root ids.
     // TODO: we could prune the 'add root page' list so it only includes
     // the pages which are not yet under one of the selected root pages.
     // That would just be an extra little usability touch.
     $data['root_ids'] = array_flip($data['root_ids']);
     foreach ($data['root_ids'] as $key => $value) {
         if (isset($data['all_pages']['pages'][$key])) {
             $data['root_ids'][$key] = $data['all_pages']['pages'][$key]['slash_separated'];
         } else {
             $data['root_ids'][$key] = xarML('Unknown');
         }
     }
     $data['prune_ids'] = array_flip($data['prune_ids']);
     foreach ($data['prune_ids'] as $key => $value) {
         if (isset($data['all_pages']['pages'][$key])) {
             $data['prune_ids'][$key] = $data['all_pages']['pages'][$key]['slash_separated'];
         } else {
             $data['prune_ids'][$key] = xarML('Unknown');
         }
     }
     //            $vars['bid'] = $blockinfo['bid'];
     return $data;
 }
开发者ID:godboko,项目名称:modules,代码行数:39,代码来源:menu_admin.php

示例4: publications_admin_stats

/**
 * view statistics
 */
function publications_admin_stats($args = array())
{
    if (!xarSecurityCheck('AdminPublications')) {
        return;
    }
    if (!xarVarFetch('group', 'isset', $group, array(), XARVAR_NOT_REQUIRED)) {
        return;
    }
    extract($args);
    if (!empty($group)) {
        $newgroup = array();
        foreach ($group as $field) {
            if (empty($field)) {
                continue;
            }
            $newgroup[] = $field;
        }
        $group = $newgroup;
    }
    if (empty($group)) {
        $group = array('pubtype_id', 'state', 'owner');
    }
    $data = array();
    $data['group'] = $group;
    $data['stats'] = xarModAPIFunc('publications', 'admin', 'getstats', array('group' => $group));
    $data['pubtypes'] = xarModAPIFunc('publications', 'user', 'get_pubtypes');
    $data['statelist'] = xarModAPIFunc('publications', 'user', 'getstates');
    $data['fields'] = array('pubtype_id' => xarML('Publication Type'), 'state' => xarML('Status'), 'owner' => xarML('Author'), 'pubdate_year' => xarML('Publication Year'), 'pubdate_month' => xarML('Publication Month'), 'pubdate_day' => xarML('Publication Day'), 'locale' => xarML('Language'));
    return $data;
}
开发者ID:godboko,项目名称:modules,代码行数:33,代码来源:stats.php

示例5: publications_userapi_getitemlinks

/**
 * utility function to pass individual item links to a caller
 *
 * @param $args['itemids'] array of item ids to get
 * @return array Array containing the itemlink(s) for the item(s).
 */
function publications_userapi_getitemlinks($args)
{
    $itemlinks = array();
    sys::import('xaraya.structures.query');
    $xartable = xarDB::getTables();
    $q = new Query('SELECT', $xartable['publications']);
    $q->addfield('id');
    $q->addfield('title');
    $q->addfield('description');
    $q->addfield('pubtype_id');
    $q->in('state', array(3, 4));
    if (!empty($args['itemids'])) {
        $itemids = explode(',', $args['itemids']);
        $q->in('id', $itemids);
    }
    $q->addorder('title');
    $q->run();
    $result = $q->output();
    if (empty($result)) {
        return $itemlinks;
    }
    foreach ($result as $item) {
        if (empty($item['title'])) {
            $item['title'] = xarML('Display Publication');
        }
        $itemlinks[$item['id']] = array('url' => xarModURL('publications', 'user', 'display', array('id' => $item['id'])), 'title' => $item['title'], 'label' => $item['description']);
    }
    return $itemlinks;
}
开发者ID:godboko,项目名称:modules,代码行数:35,代码来源:getitemlinks.php

示例6: shop_admin_modifycustomer

/**
 *  Modify a customer
 */
function shop_admin_modifycustomer()
{
    if (!xarVarFetch('itemid', 'id', $data['itemid'], NULL, XARVAR_DONT_SET)) {
        return;
    }
    if (!xarVarFetch('confirm', 'bool', $data['confirm'], false, XARVAR_NOT_REQUIRED)) {
        return;
    }
    $objectname = 'shop_customers';
    $data['objectname'] = $objectname;
    // Check if we still have no id of the item to modify.
    if (empty($data['itemid'])) {
        $msg = xarML('Invalid #(1) for #(2) function #(3)() in module #(4)', 'item id', 'admin', 'modify', 'shop');
        throw new Exception($msg);
    }
    if (!xarSecurityCheck('AdminShop', 1, 'Item', $data['itemid'])) {
        return;
    }
    sys::import('modules.dynamicdata.class.objects.master');
    $object = DataObjectMaster::getObject(array('name' => $objectname));
    $data['object'] = $object;
    $data['label'] = $object->label;
    $object->getItem(array('itemid' => $data['itemid']));
    $values = $object->getFieldValues();
    foreach ($values as $name => $value) {
        $data[$name] = xarVarPrepForDisplay($value);
    }
    $rolesobject = DataObjectMaster::getObject(array('name' => 'roles_users'));
    $rolesobject->getItem(array('itemid' => $data['itemid']));
    if ($data['confirm']) {
        // Check for a valid confirmation key
        if (!xarSecConfirmAuthKey()) {
            return xarTplModule('privileges', 'user', 'errors', array('layout' => 'bad_author'));
        }
        // Get the data from the form
        $isvalid = $object->checkInput();
        if (!$isvalid) {
            // Bad data: redisplay the form with the data we picked up and with error messages
            return xarTplModule('shop', 'admin', 'modifycustomer', $data);
        } elseif (isset($data['preview'])) {
            // Show a preview, same thing as the above essentially
            return xarTplModule('shop', 'admin', 'modifycustomer', $data);
        } else {
            $first_name = $object->properties['first_name']->getValue();
            $last_name = $object->properties['last_name']->getValue();
            $rolesobject->properties['name']->setValue($first_name . ' ' . $last_name);
            $rolesobject->updateItem();
            $object->updateItem();
            // Jump to the next page
            xarResponse::redirect(xarModURL('shop', 'admin', 'modifycustomer', array('itemid' => $data['itemid'])));
            return $data;
        }
    } else {
        // Get that specific item of the object
        $object->getItem(array('itemid' => $data['itemid']));
    }
    // Return the template variables defined in this function
    return $data;
}
开发者ID:godboko,项目名称:modules,代码行数:62,代码来源:modifycustomer.php

示例7: calendar_adminapi_create_calendars

/**
 * @returns int (calendar id on success, false on failure)
 */
function calendar_adminapi_create_calendars($args)
{
    extract($args);
    // argument check
    if (!isset($calname)) {
        $msg = xarML('Calendar name not specified', 'admin', 'create', 'calendar');
        throw new Exception($msg);
    }
    // TODO: should I move these two issets to the admin function
    // admin/create_calendars.php? --amoro
    if (!isset($mod_id)) {
        $module = xarController::$request->getInfo();
        $mod_id = xarMod::getRegID($module[0]);
    }
    if (!isset($role_id)) {
        $role_id = xarSession::getVar('role_id');
    }
    // Load up database details.
    $dbconn = xarDB::getConn();
    $xartable = xarDB::getTables();
    $caltable = $xartable['calendars'];
    // Insert instance details.
    $nextId = $dbconn->GenId($caltable);
    $query = 'INSERT INTO ' . $caltable . ' (
              xar_id,
              xar_role_id,
              xar_mod_id,
              xar_name
            ) VALUES (?, ?, ?, ?)';
    $result =& $dbconn->Execute($query, array($nextId, $role_id, $mod_id, $calname));
    if (!$result) {
        return;
    }
    // Get ID of row inserted.
    $calendid = $dbconn->PO_Insert_ID($caltable, 'xar_id');
    // If not database type also add file info
    // Allow duplicate files here, to make it easier to delete them
    // WARNING: if somebody changes this you should also change the
    // delete function to avoid major dataloss!!! --amoro
    if ($addtype != 'db') {
        $filestable = $xartable['calfiles'];
        $cal_filestable = $xartable['calendars_files'];
        $nextID = $dbconn->GenId($filestable);
        $query = 'INSERT INTO ' . $filestable . ' (
                  xar_id,
                  xar_path
                ) VALUES (?, ?)';
        $result =& $dbconn->Execute($query, array($nextID, $fileuri));
        // Get ID of row inserted.
        $fileid = $dbconn->PO_Insert_ID($filestable, 'xar_id');
        $query = 'INSERT INTO ' . $cal_filestable . ' (
                      xar_calendars_id,
                      xar_files_id
                    ) VALUES (?, ?)';
        $result =& $dbconn->Execute($query, array($calendid, $fileid));
    }
    return $calendid;
}
开发者ID:godboko,项目名称:modules,代码行数:61,代码来源:create_calendars.php

示例8: publications_adminapi_createpubtype

/**
 * Create a new publication type
 *
 * @param $args['name'] name of the publication type
 * @param $args['descr'] description of the publication type
 * @param $args['config'] configuration of the publication type
 * @return int publication type ID on success, false on failure
 */
function publications_adminapi_createpubtype($args)
{
    // Get arguments from argument array
    extract($args);
    // Argument check - make sure that all required arguments are present
    // and in the right format, if not then set an appropriate error
    // message and return
    // Note : since we have several arguments we want to check here, we'll
    // report all those that are invalid at the same time...
    $invalid = array();
    if (!isset($name) || !is_string($name) || empty($name)) {
        $invalid[] = 'name';
    }
    if (!isset($config) || !is_array($config) || count($config) == 0) {
        $invalid[] = 'configuration';
    }
    if (count($invalid) > 0) {
        $msg = xarML('Invalid #(1) for #(2) function #(3)() in module #(4)', join(', ', $invalid), 'admin', 'createpubtype', 'Publications');
        throw new BadParameterException(null, $msg);
    }
    if (empty($descr)) {
        $descr = $name;
    }
    // Publication type names *must* be lower-case for now
    $name = strtolower($name);
    // Security check - we require ADMIN rights here
    if (!xarSecurityCheck('AdminPublications')) {
        return;
    }
    if (!xarModAPILoad('publications', 'user')) {
        return;
    }
    // Make sure we have all the configuration fields we need
    $pubfields = xarModAPIFunc('publications', 'user', 'getpubfields');
    foreach ($pubfields as $field => $value) {
        if (!isset($config[$field])) {
            $config[$field] = '';
        }
    }
    // Get database setup
    $dbconn = xarDB::getConn();
    $xartable = xarDB::getTables();
    $pubtypestable = $xartable['publication_types'];
    // Get next ID in table
    $nextId = $dbconn->GenId($pubtypestable);
    // Insert the publication type
    $query = "INSERT INTO {$pubtypestable} (pubtype_id, pubtypename,\n            pubtypedescr, pubtypeconfig)\n            VALUES (?,?,?,?)";
    $bindvars = array($nextId, $name, $descr, serialize($config));
    $result =& $dbconn->Execute($query, $bindvars);
    if (!$result) {
        return;
    }
    // Get ptid to return
    $ptid = $dbconn->PO_Insert_ID($pubtypestable, 'pubtype_id');
    // Don't call creation hooks here...
    //xarModCallHooks('item', 'create', $ptid, 'ptid');
    return $ptid;
}
开发者ID:godboko,项目名称:modules,代码行数:66,代码来源:createpubtype.php

示例9: modify

 function modify()
 {
     $data = $this->getContent();
     $data['fields'] = array('id', 'name');
     if (!is_array($data['pubstate'])) {
         $statearray = array($data['pubstate']);
     } else {
         $statearray = $data['pubstate'];
     }
     if (!empty($data['catfilter'])) {
         $cidsarray = array($data['catfilter']);
     } else {
         $cidsarray = array();
     }
     // Create array based on modifications
     $article_args = array();
     // Only include pubtype if a specific pubtype is selected
     if (!empty($data['pubtype_id'])) {
         $article_args['ptid'] = $data['pubtype_id'];
     }
     // If itemlimit is set to 0, then don't pass to getall
     if ($data['itemlimit'] != 0) {
         $article_args['numitems'] = $data['itemlimit'];
     }
     // Add the rest of the arguments
     $article_args['cids'] = $cidsarray;
     $article_args['enddate'] = time();
     $article_args['state'] = $statearray;
     $article_args['fields'] = $data['fields'];
     $article_args['sort'] = $data['toptype'];
     $data['filtereditems'] = xarModAPIFunc('publications', 'user', 'getall', $article_args);
     // Check for exceptions
     //    if (!isset($vars['filtereditems']) && xarCurrentErrorType() != XAR_NO_EXCEPTION)
     //        return; // throw back
     // Try to keep the additional headlines select list width less than 50 characters
     for ($idx = 0; $idx < count($data['filtereditems']); $idx++) {
         if (strlen($data['filtereditems'][$idx]['title']) > 50) {
             $data['filtereditems'][$idx]['title'] = substr($data['filtereditems'][$idx]['title'], 0, 47) . '...';
         }
     }
     $data['pubtypes'] = xarModAPIFunc('publications', 'user', 'get_pubtypes');
     $data['categorylist'] = xarModAPIFunc('categories', 'user', 'getcat');
     $data['stateoptions'] = array(array('id' => '', 'name' => xarML('All Published')), array('id' => '3', 'name' => xarML('Frontpage')), array('id' => '2', 'name' => xarML('Approved')));
     $data['sortoptions'] = array(array('id' => 'author', 'name' => xarML('Author')), array('id' => 'date', 'name' => xarML('Date')), array('id' => 'hits', 'name' => xarML('Hit Count')), array('id' => 'rating', 'name' => xarML('Rating')), array('id' => 'title', 'name' => xarML('Title')));
     //Put together the additional featured publications list
     for ($idx = 0; $idx < count($data['filtereditems']); ++$idx) {
         $data['filtereditems'][$idx]['selected'] = '';
         for ($mx = 0; $mx < count($data['moreitems']); ++$mx) {
             if ($data['moreitems'][$mx] == $data['filtereditems'][$idx]['id']) {
                 $data['filtereditems'][$idx]['selected'] = 'selected';
             }
         }
     }
     $data['morepublications'] = $data['filtereditems'];
     return $data;
 }
开发者ID:godboko,项目名称:modules,代码行数:56,代码来源:featureditems_admin.php

示例10: publications_admin_importpubtype

/**
 * Import an object definition or an object item from XML
 */
function publications_admin_importpubtype($args)
{
    if (!xarSecurityCheck('AdminPublications')) {
        return;
    }
    if (!xarVarFetch('import', 'isset', $import, NULL, XARVAR_DONT_SET)) {
        return;
    }
    if (!xarVarFetch('xml', 'isset', $xml, NULL, XARVAR_DONT_SET)) {
        return;
    }
    extract($args);
    $data = array();
    $data['menutitle'] = xarML('Dynamic Data Utilities');
    $data['warning'] = '';
    $data['options'] = array();
    $basedir = 'modules/publications';
    $filetype = 'xml';
    $files = xarModAPIFunc('dynamicdata', 'admin', 'browse', array('basedir' => $basedir, 'filetype' => $filetype));
    if (!isset($files) || count($files) < 1) {
        $files = array();
        $data['warning'] = xarML('There are currently no XML files available for import in "#(1)"', $basedir);
    }
    if (!empty($import) || !empty($xml)) {
        if (!xarSecConfirmAuthKey()) {
            return;
        }
        if (!empty($import)) {
            $found = '';
            foreach ($files as $file) {
                if ($file == $import) {
                    $found = $file;
                    break;
                }
            }
            if (empty($found) || !file_exists($basedir . '/' . $file)) {
                $msg = xarML('File not found');
                throw new BadParameterException(null, $msg);
            }
            $ptid = xarModAPIFunc('publications', 'admin', 'importpubtype', array('file' => $basedir . '/' . $file));
        } else {
            $ptid = xarModAPIFunc('publications', 'admin', 'importpubtype', array('xml' => $xml));
        }
        if (empty($ptid)) {
            return;
        }
        $data['warning'] = xarML('Publication type #(1) was successfully imported', $ptid);
    }
    natsort($files);
    array_unshift($files, '');
    foreach ($files as $file) {
        $data['options'][] = array('id' => $file, 'name' => $file);
    }
    $data['authid'] = xarSecGenAuthKey();
    return $data;
}
开发者ID:godboko,项目名称:modules,代码行数:59,代码来源:importpubtype.php

示例11: xarML

/**
* get array of field formats for publication types
* @TODO : move this to some common place in Xaraya (base module ?)
* + replace with dynamic_propertytypes table
*
* + extend with other pre-defined formats
* @return array('static'  => xarML('Static Text'),
                'textbox' => xarML('Text Box'),
                ...);
*/
function publications_userapi_getpubfieldformats($args)
{
    $fieldlist = array('static' => xarML('Static Text'), 'textbox' => xarML('Text Box'), 'textarea' => xarML('Small Text Area'), 'textarea_medium' => xarML('Medium Text Area'), 'textarea_large' => xarML('Large Text Area'), 'dropdown' => xarML('Dropdown List'), 'textupload' => xarML('Text Upload'), 'fileupload' => xarML('File Upload'), 'url' => xarML('URL'), 'urltitle' => xarML('URL + Title'), 'image' => xarML('Image'), 'imagelist' => xarML('Image List'), 'calendar' => xarML('Calendar'), 'webpage' => xarML('HTML Page'), 'username' => xarML('Username'), 'userlist' => xarML('User List'), 'state' => xarML('Status'), 'locale' => xarML('Language List'));
    // Add  'text' dd properites that are dependent on module availability
    $extrafields = array();
    if (xarModIsAvailable('tinymce')) {
        $extrafields = array('tinymce' => xarML('TinyMCE GUI'));
        $fieldlist = array_merge($fieldlist, $extrafields);
    }
    return $fieldlist;
}
开发者ID:godboko,项目名称:modules,代码行数:21,代码来源:getpubfieldformats.php

示例12: calendar_adminapi_hookcreate

function calendar_adminapi_hookcreate($data)
{
    if (!isset($data['extrainfo']) || !is_array($data['extrainfo'])) {
        $data['extrainfo'] = array();
    }
    // When called via hooks, modname will be empty, but we get it from the
    // extrainfo or the current module
    if (empty($data['module'])) {
        if (!empty($data['extrainfo']['module'])) {
            $data['module'] = $data['extrainfo']['module'];
        } else {
            $data['module'] = xarMod::getName();
        }
    }
    $data['module_id'] = xarMod::getID($data['module']);
    if (empty($data['module_id'])) {
        throw new IDNotFoundException("module id for " . $data['modname']);
    }
    if (!isset($data['itemtype']) || !is_numeric($data['itemtype'])) {
        if (isset($data['extrainfo']['itemtype']) && is_numeric($data['extrainfo']['itemtype'])) {
            $data['itemtype'] = $data['extrainfo']['itemtype'];
        } else {
            $data['itemtype'] = 0;
        }
    }
    if (!isset($data['itemid']) || !is_numeric($data['itemid'])) {
        if (isset($data['extrainfo']['item_id']) && is_numeric($data['extrainfo']['item_id'])) {
            $data['itemid'] = $data['extrainfo']['item_id'];
        } else {
            $data['itemid'] = 0;
        }
    }
    $data['extrainfo']['module_id'] = $data['module_id'];
    $data['extrainfo']['itemtype'] = $data['itemtype'];
    $data['extrainfo']['item_id'] = $data['itemid'];
    $data['extrainfo']['name'] = isset($data['extrainfo']['name']) ? $data['extrainfo']['name'] : xarML('Unknown Event');
    $data['extrainfo']['start_time'] = isset($data['extrainfo']['start_time']) ? $data['extrainfo']['start_time'] : time();
    $data['extrainfo']['duration'] = isset($data['extrainfo']['duration']) ? $data['extrainfo']['duration'] : 60;
    $data['extrainfo']['end_time'] = isset($data['extrainfo']['end_time']) ? $data['extrainfo']['end_time'] : $data['extrainfo']['start_time'] + $data['extrainfo']['duration'];
    $data['extrainfo']['recurring_code'] = isset($data['extrainfo']['recurring_code']) ? $data['extrainfo']['recurring_code'] : 0;
    $data['extrainfo']['recurring_span'] = isset($data['extrainfo']['recurring_span']) ? $data['extrainfo']['recurring_span'] : 0;
    $data['extrainfo']['start_location'] = isset($data['extrainfo']['start_location']) ? $data['extrainfo']['start_location'] : null;
    $data['extrainfo']['end_location'] = isset($data['extrainfo']['end_location']) ? $data['extrainfo']['end_location'] : null;
    $data['extrainfo']['object_id'] = isset($data['extrainfo']['object_id']) ? $data['extrainfo']['object_id'] : 0;
    $data['extrainfo']['role_id'] = isset($data['extrainfo']['role_id']) ? $data['extrainfo']['role_id'] : xarSession::getVar('role_id');
    $data['extrainfo']['return_link'] = isset($data['extrainfo']['return_link']) ? $data['extrainfo']['return_link'] : '';
    $data['extrainfo']['state'] = isset($data['extrainfo']['state']) ? $data['extrainfo']['state'] : 3;
    $data['extrainfo']['timestamp'] = isset($data['extrainfo']['timestamp']) ? $data['extrainfo']['timestamp'] : time();
    $data['extrainfo']['itemid'] = 0;
    $object = DataObjectMaster::getObject(array('name' => 'calendar_event'));
    $item = $object->createItem($data['extrainfo']);
    return $data['extrainfo'];
}
开发者ID:godboko,项目名称:modules,代码行数:53,代码来源:hookcreate.php

示例13: calendar_adminapi_menu

/**
 * generate the common admin menu configuration
 */
function calendar_adminapi_menu()
{
    // Initialise the array that will hold the menu configuration
    $menu = array();
    // Specify the menu title to be used in your blocklayout template
    $menu['menutitle'] = xarML('Calendar Administration');
    // Specify the menu labels to be used in your blocklayout template
    // Preset some status variable
    $menu['status'] = '';
    // Return the array containing the menu configuration
    return $menu;
}
开发者ID:godboko,项目名称:modules,代码行数:15,代码来源:menu.php

示例14: calendar_admin_create_calendars

function calendar_admin_create_calendars()
{
    // Get parameters
    // TODO HELPNEEDED here: how do I handle this (e.g. missing calname should return a
    // message
    if (!xarVarFetch('add_calendar', 'isset', $add_calendar)) {
        return;
    }
    if (!xarVarFetch('calname', 'str:1:', $calname)) {
        return;
    }
    if (!xarVarFetch('addtype', 'str:1:', $addtype)) {
        return;
    }
    if (!xarVarFetch('location', 'str:1:', $location, '', XARVAR_NOT_REQUIRED)) {
        return;
    }
    if (!xarVarFetch('uri', 'str:1:', $uri, '', XARVAR_NOT_REQUIRED)) {
        return;
    }
    // Confirm Auth Key
    if (!xarSecConfirmAuthKey()) {
        return;
    }
    // Security Check
    // TODO
    //    if(!xarSecurityCheck('AddCalendar', 0, 'Calendar')) {return;}
    // Check if module name has already been used.
    $checkname = xarMod::apiFunc('calendar', 'user', 'get', array('calname' => $calname));
    if (!empty($checkname)) {
        $msg = xarML('Calendar name "#(1)" already exists. Please go back and enter a
                      different name', $calname);
        throw new Exception($msg);
    }
    if ($addtype == 'db') {
        $fileuri = 'a';
    } elseif ($addtype == 'file') {
        $fileuri = $location;
    } elseif ($addtype == 'uri') {
        $fileuri = $uri;
    }
    // Pass to API
    $calid = xarMod::apiFunc('calendar', 'admin', 'create_calendars', array('calname' => $calname, 'fileuri' => $fileuri, 'addtype' => $addtype));
    if (!$calid) {
        return;
    }
    // Go on and edit the new instance
    xarController::redirect(xarModURL('calendar', 'admin', 'add_calendars', array('calid' => $calid, 'calname' => $calname)));
}
开发者ID:godboko,项目名称:modules,代码行数:49,代码来源:create_calendars.php

示例15: publications_adminapi_getpubtypeaccess

function publications_adminapi_getpubtypeaccess($args)
{
    if (!isset($args['ptid'])) {
        throw new Exception(xarML('Missing ptid param in publications_adminapi_getpubtypeaccess'));
    }
    $pubtypeobject = DataObjectMaster::getObject(array('name' => 'publications_types'));
    if (null == $pubtypeobject) {
        return false;
    }
    $pubtypeobject->getItem(array('itemid' => $args['ptid']));
    if (empty($pubtypeobject->properties['access']->value)) {
        return "a:0:{}";
    }
    return $pubtypeobject->properties['access']->value;
}
开发者ID:godboko,项目名称:modules,代码行数:15,代码来源:getpubtypeaccess.php


注:本文中的xarML函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。