本文整理汇总了PHP中xoonips_getormhandler函数的典型用法代码示例。如果您正苦于以下问题:PHP xoonips_getormhandler函数的具体用法?PHP xoonips_getormhandler怎么用?PHP xoonips_getormhandler使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了xoonips_getormhandler函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_xoonips_item_template_vars
function get_xoonips_item_template_vars()
{
$basic =& $this->_params['item']->getVar('basic');
$result = array('basic' => array('item_id' => $basic->get('item_id'), 'description' => $basic->getVar('description', 's'), 'doi' => $basic->get('doi'), 'creation_date' => $basic->get('creation_date'), 'last_update_date' => $basic->get('last_update_date'), 'publication_year' => $basic->get('publication_year'), 'publication_month' => $basic->get('publication_month'), 'publication_mday' => $basic->get('publication_mday'), 'lang' => $this->get_lang_label()), 'title' => array(), 'keyword' => array(), 'changelog' => array(), 'index_item_link' => array(), 'related_tos' => array());
foreach ($this->_params['item']->getVar('titles') as $title) {
$result['title'][] = array('title' => $title->getVar('title', 's'));
}
foreach ($this->_params['item']->getVar('keywords') as $keyword) {
$result['keyword'][] = array('keyword' => $keyword->getVar('keyword', 's'));
}
foreach ($this->_params['item']->getVar('changelogs') as $changelog) {
$result['changelog'][] = array('log_date' => $changelog->get('log_date'), 'log' => $changelog->getVar('log', 's'));
}
foreach ($this->_params['item']->getVar('indexes') as $link) {
$result['index_item_link'][] = array('path' => $this->get_index_path_by_index_id($link->get('index_id')), 's');
}
$item_type_handler =& xoonips_getormhandler('xoonips', 'item_type');
$basic_handler =& xoonips_getormhandler('xoonips', 'item_basic');
foreach ($this->_params['item']->getVar('related_tos') as $related_to) {
$related_basic =& $basic_handler->get($related_to->get('item_id'));
$related_item_type =& $item_type_handler->get($related_basic->get('item_type_id'));
$item_compo_handler =& xoonips_getormcompohandler($related_item_type->get('name'), 'item');
$result['related_tos'][] = array('filename' => 'db:' . $item_compo_handler->getTemplateFileName(XOONIPS_TEMPLATE_TYPE_TRANSFER_ITEM_LIST), 'var' => $item_compo_handler->getTemplateVar(XOONIPS_TEMPLATE_TYPE_TRANSFER_ITEM_LIST, $related_basic->get('item_id')));
}
return $result;
}
开发者ID:XoopsModules25x,项目名称:xcl-module-xoonips,代码行数:26,代码来源:transfer_user_requested_item_detail.class.php
示例2: postAction
function postAction()
{
global $xoopsUser;
if (!$this->_response->getResult()) {
foreach ($this->_collection->getItems() as $item) {
foreach ($item->getErrorCodes() as $code) {
if ($code != E_XOONIPS_UPDATE_CERTIFY_REQUEST_LOCKED) {
continue;
}
$titles =& $item->getVar('titles');
$item_lock_handler =& xoonips_getormhandler('xoonips', 'item_lock');
redirect_header(XOOPS_URL . '/modules/xoonips/import.php?action=default', 5, sprintf(_MD_XOONIPS_ERROR_CANNOT_OVERWRITE_LOCKED_ITEM, $titles[0]->get('title'), xoonips_get_lock_type_string($item_lock_handler->getLockType($item->getUpdateItemId()))));
}
}
}
$this->_finish_time = time();
$success =& $this->_response->getSuccess();
$this->_view_params['result'] = $this->_response->getResult();
$this->_view_params['import_items'] = $success['import_items'];
$this->_view_params['begin_time'] = $this->_begin_time;
$this->_view_params['finish_time'] = $this->_finish_time;
$this->_view_params['filename'] = $this->_collection->getImportFileName();
$this->_view_params['uname'] = $xoopsUser->getVar('uname');
$this->_view_params['errors'] = array();
foreach ($success['import_items'] as $item) {
foreach (array_unique($item->getErrorCodes()) as $code) {
$this->_view_params['errors'][] = array('code' => $code, 'extra' => $item->getPseudoId());
}
}
}
示例3: xoonips_admin_maintenance_item_unlock_item
/**
*
* @brief unlock item
*
* @param[in] $item_id item id
*/
function xoonips_admin_maintenance_item_unlock_item($item_id)
{
// unlock item
$index_handler =& xoonips_getormhandler('xoonips', 'index');
$item_lock_handler =& xoonips_getormhandler('xoonips', 'item_lock');
$item_basic_handler =& xoonips_getormhandler('xoonips', 'item_basic');
$index_item_link_handler =& xoonips_getormhandler('xoonips', 'index_item_link');
$event_log_handler =& xoonips_getormhandler('xoonips', 'event_log');
if ($item_lock_handler->isLocked($item_id)) {
$lock_type = $item_lock_handler->getLockType($item_id);
if ($lock_type == XOONIPS_LOCK_TYPE_CERTIFY_REQUEST) {
$index_item_links =& $index_item_link_handler->getObjects(new Criteria('item_id', $item_id));
foreach ($index_item_links as $index_item_link) {
if ($index_item_link->get('certify_state') == CERTIFY_REQUIRED) {
$index_id = $index_item_link->get('index_id');
$index = $index_handler->get($index_id);
if ($index->getVar('open_level', 'n') == OL_PUBLIC || $index->getVar('open_level', 'n') == OL_GROUP_ONLY) {
$item_basic_handler->unlockItemAndIndexes($item_id, $index_id);
$event_log_handler->recordRejectItemEvent($item_id, $index_id);
$index_item_link_handler->delete($index_item_link);
xoonips_notification_item_rejected($item_id, $index_id);
}
}
}
} else {
// TODO: unlock if transfer request
}
}
}
示例4: xoonips_getormhandler
/**
* return XooNIpsXmlRpcItemView corresponding to $logic and $item(itemtype)
*
* @param string $logic logic name
* @param XooNIpsItemCompo item object
* @retval XooNIpsXmlRpcItemViewElement corresponding to $logic
* @retval false unknown logic or unknown item
*/
function &create($logic, &$item)
{
static $falseVar = false;
$item_type_handler =& xoonips_getormhandler('xoonips', 'item_type');
$basic =& $item->getVar('basic');
$itemtype =& $item_type_handler->get($basic->get('item_type_id'));
if (!$itemtype) {
return $falseVar;
}
//
$name = $itemtype->get('name');
//
$include_file = XOOPS_ROOT_PATH . "/modules/{$name}/class/xmlrpc/view/" . strtolower($logic) . ".class.php";
if (file_exists($include_file)) {
include_once $include_file;
} else {
return $falseVar;
}
//
if (strncmp('xnp', $name, 3) == 0) {
$tok = substr($name, 3);
$class = 'XNP' . ucfirst($tok) . 'XmlRpcItemView' . ucfirst($logic);
$ret = new $class($item);
return $ret;
}
return $falseVar;
}
示例5: item_get_userlist
function item_get_userlist($upage)
{
global $xoopsDB;
global $xoopsUser;
// myuid
$myuid = $xoopsUser->getVar('uid', 'n');
$xusers_handler =& xoonips_getormhandler('xoonips', 'users');
$tables['users'] = $xoopsDB->prefix('users');
$tables['xusers'] = $xoopsDB->prefix('xoonips_users');
$join_criteria = new XooNIpsJoinCriteria('users', 'uid', 'uid');
$criteria = new Criteria($tables['users'] . '.level', 0, '>');
$criteria->setSort($tables['users'] . '.uname');
$fields = array();
$fields[] = $tables['xusers'] . '.uid';
$fields[] = $tables['users'] . '.uname';
$xusers_objs =& $xusers_handler->getObjects($criteria, false, implode(',', $fields), false, $join_criteria);
$textutil =& xoonips_getutility('text');
$users = array();
$users[] = array('uid' => 0, 'uname' => $textutil->html_special_chars(_AM_XOONIPS_MAINTENANCE_ITEM_LABEL_ALLUSERS), 'selected' => 'selected="selected"');
foreach ($xusers_objs as $xusers_obj) {
$uid = $xusers_obj->getVar('uid', 'e');
$uname = $textutil->html_special_chars($xusers_obj->getExtraVar('uname'));
$users[] = array('uid' => $uid, 'uname' => $uname, 'selected' => '');
}
return $users;
}
示例6: execute_without_transaction
/**
* transfer request
*
* @param[in] $vars[0] array of item_id
* @param[in] $vars[1] uid of old item owner
* @param[in] $vars[2] uid of new item owner
* @param[out] XooNIpsError error
* @return bool true if succeeded
*/
function execute_without_transaction(&$vars, &$error)
{
$item_ids = $vars[0];
$from_uid = $vars[1];
$to_uid = $vars[2];
if (false == xoonips_transfer_is_transferrable($from_uid, $to_uid, $item_ids)) {
$error->add(XNPERR_SERVER_ERROR, "not transferrable");
return false;
}
foreach ($item_ids as $item_id) {
$transfer_request_handler =& xoonips_getormhandler('xoonips', 'transfer_request');
$transfer_request = $transfer_request_handler->create();
$transfer_request->set('item_id', $item_id);
$transfer_request->set('to_uid', $to_uid);
if (false == $transfer_request_handler->insert($transfer_request)) {
$error->add(XNPERR_SERVER_ERROR, "cannot insert tranfer_request");
return false;
}
$item_lock_handler =& xoonips_getormhandler('xoonips', 'item_lock');
if (false == $item_lock_handler->lock($item_id)) {
$error->add(XNPERR_SERVER_ERROR, "cannot lock item");
return false;
}
$eventlog_handler =& xoonips_getormhandler('xoonips', 'event_log');
if (false == $eventlog_handler->recordRequestTransferItemEvent($item_id, $to_uid)) {
$error->add(XNPERR_SERVER_ERROR, "cannot insert evnet log");
return false;
}
}
return true;
}
示例7: userCheck
function userCheck($uname, $email, $pass, $vpass)
{
global $myxoopsConfigUser;
$xoopsDB =& Database::getInstance();
$stop = '';
if (!checkEmail($email)) {
$stop .= _US_INVALIDMAIL . '<br />';
}
foreach ($myxoopsConfigUser['bad_emails'] as $be) {
if (!empty($be) && preg_match('/' . $be . '/i', $email)) {
$stop .= _US_INVALIDMAIL . '<br />';
break;
}
}
if (strrpos($email, ' ') > 0) {
$stop .= _US_EMAILNOSPACES . '<br />';
}
$uname = xoops_trim($uname);
$restrictions = array(0 => '/[^a-zA-Z0-9\\_\\-]/', 1 => '/[^a-zA-Z0-9\\_\\-\\<\\>\\,\\.\\$\\%\\#\\@\\!\\\'\\"]/', 2 => '/[\\000-\\040]/');
$restriction = $restrictions[$myxoopsConfigUser['uname_test_level']];
if (empty($uname) || preg_match($restriction, $uname)) {
$stop .= _US_INVALIDNICKNAME . '<br />';
}
if (strlen($uname) > $myxoopsConfigUser['maxuname']) {
$stop .= sprintf(_US_NICKNAMETOOLONG, $myxoopsConfigUser['maxuname']) . '<br />';
}
if (strlen($uname) < $myxoopsConfigUser['minuname']) {
$stop .= sprintf(_US_NICKNAMETOOSHORT, $myxoopsConfigUser['minuname']) . '<br />';
}
foreach ($myxoopsConfigUser['bad_unames'] as $bu) {
if (!empty($bu) && preg_match('/' . $bu . '/i', $uname)) {
$stop .= _US_NAMERESERVED . '<br />';
break;
}
}
if (strrpos($uname, ' ') > 0) {
$stop .= _US_NICKNAMENOSPACES . '<br />';
}
$u_handler =& xoonips_getormhandler('xoonips', 'xoops_users');
$criteria = new Criteria('uname', addslashes($uname));
if ($u_handler->getCount($criteria) > 0) {
$stop .= _US_NICKNAMETAKEN . "<br />";
}
if ($email) {
$criteria = new Criteria('email', addslashes($email));
if ($u_handler->getCount($criteria) > 0) {
$stop .= _US_EMAILTAKEN . "<br />";
}
}
if (!isset($pass) || $pass == '' || !isset($vpass) || $vpass == '') {
$stop .= _US_ENTERPWD . '<br />';
}
if (isset($pass) && $pass != $vpass) {
$stop .= _US_PASSNOTSAME . '<br />';
} elseif ($pass != '' && strlen($pass) < $myxoopsConfigUser['minpass']) {
$stop .= sprintf(_US_PWDTOOSHORT, $myxoopsConfigUser['minpass']) . '<br />';
}
return $stop;
}
示例8: XooNIpsUtilityFile
/**
* constructor
*
* @access public
*/
function XooNIpsUtilityFile()
{
$this->setSingleton();
$xconfig_handler =& xoonips_getormhandler('xoonips', 'config');
$this->magic_file_path = $xconfig_handler->getValue('magic_file_path');
// append additional mimetype mapping
$this->mimetype_map['application/zip'] = $this->mimetype_map['application/x-zip'];
}
示例9: XooNIpsFileHandler
/**
* constractor
*
* @access public
*/
function XooNIpsFileHandler()
{
$this->xf_handler =& xoonips_getormhandler('xoonips', 'file');
$this->xst_handler =& xoonips_getormhandler('xoonips', 'search_text');
$xc_handler =& xoonips_getormhandler('xoonips', 'config');
$this->upload_dir = $xc_handler->getValue('upload_dir');
if (strlen($this->upload_dir) > 1 && substr($this->upload_dir, -1) == '/') {
$this->upload_dir = substr($this->upload_dir, 0, strlen($this->upload_dir) - 1);
}
}
示例10: _getItemTitle
function _getItemTitle($item_id, $fmt)
{
$it_handler =& xoonips_getormhandler('xoonips', 'title');
$title = '';
$tobjs = $it_handler->getTitles($item_id);
foreach ($tobjs as $tobj) {
$title .= $tobj->get('title', $fmt);
}
return $title;
}
示例11: getCreators
/**
* get creator objects of this item
* @return XNPConferenceOrmCreator[]
*/
function getCreators()
{
$handler =& xoonips_getormhandler('xnpmodel', 'creator');
$criteria = new Criteria('model_id', $this->get('model_id'));
$criteria->setSort('creator_order');
$result =& $handler->getObjects($criteria);
if ($result) {
return $result;
}
return array();
}
示例12: _remove_files
/**
* remove all deleted(is_deleted=1) files from file system
*/
function _remove_files()
{
$handler =& xoonips_getormhandler('xoonips', 'file');
$criteria = new Criteria('is_deleted', 1);
$delete_files =& $handler->getObjects($criteria);
if ($delete_files) {
foreach ($delete_files as $file) {
$handler->deleteFile($file);
}
}
}
示例13: getAuthors
/**
* get author objects of this item
* @return XNPPaperOrmAuthor[]
*/
function getAuthors()
{
$handler =& xoonips_getormhandler('xnppaper', 'author');
$criteria = new Criteria('paper_id', $this->get('paper_id'));
$criteria->setSort('author_order');
$result =& $handler->getObjects($criteria);
if ($result) {
return $result;
}
return array();
}
示例14: _get_result_log
function _get_result_log()
{
$log = '';
$item_type_handler =& xoonips_getormhandler('xoonips', 'item_type');
foreach ($this->_params['import_items'] as $item) {
foreach (array_unique($item->getErrorCodes()) as $code) {
$log .= "\nerror " . $code . " " . $item->getVar('pseudo_id');
}
}
return $log;
}
示例15: getDevelopers
/**
* get developer objects of this item
* @return XnpstimulusOrmDeveloper[]
*/
function getDevelopers()
{
$handler =& xoonips_getormhandler('xnpstimulus', 'developer');
$criteria = new Criteria('stimulus_id', $this->get('stimulus_id'));
$criteria->setSort('developer_order');
$result =& $handler->getObjects($criteria);
if ($result) {
return $result;
}
return array();
}