本文整理汇总了PHP中xPDOObject类的典型用法代码示例。如果您正苦于以下问题:PHP xPDOObject类的具体用法?PHP xPDOObject怎么用?PHP xPDOObject使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了xPDOObject类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: prepareRow
/**
* @param xPDOObject|quipCommentNotify $object
* @return boolean
*/
public function prepareRow(xPDOObject $object)
{
$notifyArray = $object->toArray();
$notifyArray['cls'] = '';
$notifyArray['createdon'] = !empty($notifyArray['createdon']) ? strftime('%b %d, %Y %H:%M %p', strtotime($notifyArray['createdon'])) : '';
return $notifyArray;
}
开发者ID:raadhuis,项目名称:modx-basic,代码行数:11,代码来源:getlist.class.php
示例2: prepareRow
public function prepareRow(xPDOObject $object)
{
$ff = $object->toArray();
$ff['encrypted'] = $this->modx->getCount($this->classKey, array('form' => $ff['form'], 'encrypted' => 1));
$ff['total'] = $this->modx->getCount($this->classKey, array('form' => $ff['form']));
return $ff;
}
开发者ID:raadhuis,项目名称:modx-basic,代码行数:7,代码来源:getlistsingle.class.php
示例3: prepareRow
public function prepareRow(xPDOObject $object)
{
$objectArray = $object->toArray();
$objectArray['sender_name'] = $object->get('sender_username');
$objectArray['read'] = $object->get('read') ? true : false;
return $objectArray;
}
开发者ID:adamwintle,项目名称:flexibility5,代码行数:7,代码来源:getlist.class.php
示例4: prepareRow
/**
* @param xPDOObject $object
* @return array
*/
public function prepareRow(xPDOObject $object)
{
$array = $object->toArray();
$array['actions'] = array();
if (!($user = $this->modx->getObject('modUser', $array['user_id']))) {
return $this->failure($this->modx->lexicon('identifyx_user_err_nf') . ' №' . $id);
}
$blocked = $user->Profile->get('blocked');
if ($blocked) {
$array['actions'][] = array('cls' => '', 'icon' => 'icon icon-power-off action-green', 'title' => $this->modx->lexicon('identifyx_user_enable'), 'multiple' => $this->modx->lexicon('identifyx_users_enable'), 'action' => 'unblockUser', 'button' => true, 'menu' => true);
} else {
$array['actions'][] = array('cls' => '', 'icon' => 'icon icon-power-off action-gray', 'title' => $this->modx->lexicon('identifyx_user_disable'), 'multiple' => $this->modx->lexicon('identifyx_users_disable'), 'action' => 'blockUser', 'button' => true, 'menu' => true);
}
// // Edit
// $array['actions'][] = array(
// 'cls' => '',
// 'icon' => 'icon icon-edit',
// 'title' => $this->modx->lexicon('identifyx_item_update'),
// 'multiple' => $this->modx->lexicon('identifyx_items_update'),
// 'action' => 'updateData',
// 'button' => true,
// 'menu' => true,
// );
// // Remove
// $array['actions'][] = array(
// 'cls' => '',
// 'icon' => 'icon icon-trash-o action-red',
// 'title' => $this->modx->lexicon('identifyx_item_remove'),
// 'multiple' => $this->modx->lexicon('identifyx_items_remove'),
// 'action' => 'removeData',
// 'button' => true,
// 'menu' => true,
// );
return $array;
}
开发者ID:Piterden,项目名称:IdentifyX,代码行数:39,代码来源:getlist.class.php
示例5: prepareRow
public function prepareRow(xPDOObject $object)
{
$objectArray = $object->toArray();
$objectArray['category_name'] = $object->get('category_name');
unset($objectArray['content']);
return $objectArray;
}
开发者ID:ChrstnMgcn,项目名称:revolution,代码行数:7,代码来源:getlist.class.php
示例6: prepareRow
/**
* Prepare the row for iteration
*
* @param xPDOObject $object
*
* @return array
*/
public function prepareRow(xPDOObject $object)
{
if ($this->getProperty('combo')) {
return $object->get(array('id', 'name', 'pagetitle'));
}
$array = parent::prepareRow($object);
$icon = $this->_modx23 ? 'icon' : 'fa';
$array['actions'] = array();
// View
$array['actions'][] = array('cls' => '', 'icon' => "{$icon} {$icon}-comments-o", 'title' => $this->modx->lexicon('tickets_action_view'), 'action' => 'viewThread', 'button' => empty($array['deleted']) || empty($array['closed']), 'menu' => true);
// Publish
if (!$array['closed']) {
$array['actions'][] = array('cls' => '', 'icon' => "{$icon} {$icon}-power-off action-gray", 'title' => $this->modx->lexicon('tickets_action_close'), 'multiple' => $this->modx->lexicon('tickets_action_close'), 'action' => 'closeThread', 'button' => empty($array['deleted']), 'menu' => true);
} else {
$array['actions'][] = array('cls' => '', 'icon' => "{$icon} {$icon}-power-off action-green", 'title' => $this->modx->lexicon('tickets_action_open'), 'multiple' => $this->modx->lexicon('tickets_action_open'), 'action' => 'openThread', 'button' => true, 'menu' => true);
}
// Delete
if (!$array['deleted']) {
$array['actions'][] = array('cls' => '', 'icon' => "{$icon} {$icon}-trash-o action-yellow", 'title' => $this->modx->lexicon('tickets_action_delete'), 'multiple' => $this->modx->lexicon('tickets_action_delete'), 'action' => 'deleteThread', 'button' => false, 'menu' => true);
} else {
$array['actions'][] = array('cls' => '', 'icon' => "{$icon} {$icon}-undo action-green", 'title' => $this->modx->lexicon('tickets_action_undelete'), 'multiple' => $this->modx->lexicon('tickets_action_undelete'), 'action' => 'undeleteThread', 'button' => true, 'menu' => true);
}
$array['actions'][] = array('cls' => '', 'icon' => "{$icon} {$icon}-trash-o action-red", 'title' => $this->modx->lexicon('tickets_action_remove'), 'multiple' => $this->modx->lexicon('tickets_action_remove'), 'action' => 'removeThread', 'button' => false, 'menu' => true);
// Menu
$array['actions'][] = array('cls' => '', 'icon' => "{$icon} {$icon}-cog actions-menu", 'menu' => false, 'button' => true, 'action' => 'showMenu', 'type' => 'menu');
return $array;
}
开发者ID:soulcreate,项目名称:Tickets,代码行数:34,代码来源:getlist.class.php
示例7: prepareRow
/**
* Prepare the row for iteration
* @param xPDOObject $object
* @return array
*/
public function prepareRow(xPDOObject $object)
{
$objectArray = $object->toArray();
$objectArray['catid'] = $objectArray['id'];
$objectArray['text'] = $objectArray['name'];
$hasChildren = $this->_hasChildren($objectArray['catid']);
$objectArray['leaf'] = $hasChildren ? FALSE : TRUE;
$usergroups = $object->getMany('vnewsCategoriesHasUsergroups');
$usergroupsArray = array();
if ($usergroups) {
foreach ($usergroups as $usergroup) {
$usergroupId = $usergroup->get('usergroup_id');
$c = $this->modx->newQuery('modUserGroup');
$c->where(array('id' => $usergroupId));
$modUserGroup = $this->modx->getObject('modUserGroup', $c);
if ($modUserGroup) {
$usergroupsArray[] = array('usergroup_id' => $usergroupId, 'usergroup' => $modUserGroup->get('name'));
}
}
}
$objectArray['usergroups'] = $usergroupsArray;
unset($objectArray['id']);
// avoid Ext component's ID
return $objectArray;
}
开发者ID:ksneo,项目名称:virtuNewsletter,代码行数:30,代码来源:gettreelist.class.php
示例8: prepareRow
public function prepareRow(xPDOObject $object)
{
$objectArray = $object->toArray();
$objectArray['name'] = $object->get('name') . ' - ' . $object->get('authority');
$objectArray['id'] = $object->get('authority');
return $objectArray;
}
开发者ID:ChrstnMgcn,项目名称:revolution,代码行数:7,代码来源:getauthoritylist.class.php
示例9: prepareRow
/**
* @param xPDOObject $object
*
* @return array
*/
public function prepareRow(xPDOObject $object)
{
$array = $object->toArray();
$array['key'] = $array['classKey'] . '-' . $array['item'];
switch ($array['classKey']) {
case 'modTemplate':
$array['name'] = '<a href="index.php?a=element/template/update&id=' . $array['item'] . '">' . $array['templatename'] . '</a>';
break;
case 'modChunk':
$array['name'] = '<a href="index.php?a=element/chunk/update&id=' . $array['item'] . '">' . $array['chunkname'] . '</a>';
break;
case 'modSnippet':
$array['name'] = '<a href="index.php?a=element/snippet/update&id=' . $array['item'] . '">' . $array['snippetname'] . '</a>';
break;
case 'modPlugin':
$array['name'] = '<a href="index.php?a=element/plugin/update&id=' . $array['item'] . '">' . $array['pluginname'] . '</a>';
break;
case 'modTemplateVar':
$array['name'] = '<a href="index.php?a=element/tv/update&id=' . $array['item'] . '">' . $array['tvname'] . '</a>';
break;
}
if (!isset($array['name'])) {
$array['name'] = '(' . $this->modx->lexicon('deleted') . ')';
}
unset($array['templatename'], $array['chunkname'], $array['snippetname'], $array['pluginname'], $array['id']);
$array['actions'][] = array('cls' => '', 'icon' => 'icon icon-pencil-square-o ', 'title' => $this->modx->lexicon('admintools_open'), 'action' => 'openElement', 'button' => true, 'menu' => true);
return $array;
}
开发者ID:sergant210,项目名称:AdminTools,代码行数:33,代码来源:getlist.class.php
示例10: prepareRow
/**
* @param xPDOObject $object
*
* @return array
*/
public function prepareRow(xPDOObject $object)
{
$icon = 'icon';
$array = $object->toArray();
$array['actions'] = array();
// Edit
$array['actions'][] = array('cls' => '', 'icon' => "{$icon} {$icon}-edit green", 'title' => $this->modx->lexicon('gl_action_update'), 'action' => 'update', 'button' => true, 'menu' => true);
if ($array['default']) {
return $array;
}
switch (true) {
case $array['active']:
break;
case $array['active1']:
$array['active'] = 1;
break;
case $array['active2']:
$array['active'] = 1;
break;
default:
$array['active'] = 0;
}
if (!$array['active']) {
$array['actions'][] = array('cls' => '', 'icon' => "{$icon} {$icon}-toggle-off red", 'title' => $this->modx->lexicon('gl_action_active'), 'action' => 'active', 'button' => true, 'menu' => true);
} else {
$array['actions'][] = array('cls' => '', 'icon' => "{$icon} {$icon}-toggle-on green", 'title' => $this->modx->lexicon('gl_action_inactive'), 'action' => 'inactive', 'button' => true, 'menu' => true);
}
// sep
$array['actions'][] = array('cls' => '', 'icon' => '', 'title' => '', 'action' => 'sep', 'button' => false, 'menu' => true);
// Remove
$array['actions'][] = array('cls' => '', 'icon' => "{$icon} {$icon}-trash-o red", 'title' => $this->modx->lexicon('gl_action_remove'), 'action' => 'remove', 'button' => true, 'menu' => true);
return $array;
}
开发者ID:vgrish,项目名称:gl,代码行数:38,代码来源:getlist.class.php
示例11: prepareRow
/**
* @param xPDOObject|modAccessContext $object
* @return array
*/
public function prepareRow(xPDOObject $object)
{
$objectArray = $object->toArray();
if (empty($objectArray['name'])) {
$objectArray['name'] = '(' . $this->modx->lexicon('none') . ')';
}
$objectArray['authority_name'] = !empty($objectArray['role_name']) ? $objectArray['role_name'] . ' - ' . $objectArray['authority'] : $objectArray['authority'];
/* get permissions list */
$data = $objectArray['policy_data'];
unset($objectArray['policy_data']);
$data = $this->modx->fromJSON($data);
if (!empty($data)) {
$permissions = array();
foreach ($data as $perm => $v) {
$permissions[] = $perm;
}
$objectArray['permissions'] = implode(', ', $permissions);
}
$cls = '';
if (($objectArray['target'] == 'web' || $objectArray['target'] == 'mgr') && $objectArray['policy_name'] == 'Administrator' && ($this->userGroup && $this->userGroup->get('name') == 'Administrator')) {
} else {
$cls .= 'pedit premove';
}
$objectArray['cls'] = $cls;
return $objectArray;
}
开发者ID:ChrstnMgcn,项目名称:revolution,代码行数:30,代码来源:getlist.class.php
示例12: prepareRow
public function prepareRow(xPDOObject $object)
{
$core = array('Resource', 'Object', 'Administrator', 'Load Only', 'Load, List and View');
$policyArray = $object->toArray();
$permissions = array();
$cls = 'pedit';
if (!in_array($object->get('name'), $core)) {
$cls .= ' premove';
}
$policyArray['cls'] = $cls;
if (!empty($policyArray['total_permissions'])) {
$data = $object->get('data');
$ct = 0;
if (!empty($data)) {
foreach ($data as $k => $v) {
if (!empty($v)) {
$permissions[] = $k;
$ct++;
}
}
}
$policyArray['active_permissions'] = $ct;
$policyArray['active_of'] = $this->modx->lexicon('active_of', array('active' => $policyArray['active_permissions'], 'total' => $policyArray['total_permissions']));
$policyArray['permissions'] = $permissions;
}
unset($policyArray['data']);
return $policyArray;
}
开发者ID:ChrstnMgcn,项目名称:revolution,代码行数:28,代码来源:getlist.class.php
示例13: prepareRow
/** {@inheritDoc} */
public function prepareRow(xPDOObject $object)
{
$icon = 'fa';
$array = $object->toArray();
$array['actions'] = array();
// Menu
$array['actions'][] = array('cls' => '', 'icon' => "{$icon} {$icon}-cog actions-menu", 'menu' => false, 'button' => true, 'action' => 'showMenu', 'type' => 'menu');
// Edit
$array['actions'][] = array('cls' => '', 'icon' => "{$icon} {$icon}-edit green", 'title' => $this->modx->lexicon('mlmsystem_action_edit'), 'action' => 'update', 'button' => true, 'menu' => true);
// sep
$array['actions'][] = array('cls' => '', 'icon' => '', 'title' => '', 'action' => 'sep', 'button' => false, 'menu' => true);
$array['actions'][] = array('cls' => '', 'icon' => "{$icon} {$icon}-street-view", 'title' => $this->modx->lexicon('mlmsystem_action_change_parent'), 'action' => 'changeParent', 'button' => false, 'menu' => true);
$array['actions'][] = array('cls' => '', 'icon' => "{$icon} {$icon}-money ", 'title' => $this->modx->lexicon('mlmsystem_action_change_balance'), 'action' => 'changeBalance', 'button' => true, 'menu' => true);
// sep
$array['actions'][] = array('cls' => '', 'icon' => '', 'title' => '', 'action' => 'sep', 'button' => false, 'menu' => true);
//Blocked status
if ($array['status'] != $this->statusBlocked) {
$array['actions'][] = array('cls' => '', 'icon' => "{$icon} {$icon}-unlock-alt red", 'title' => $this->modx->lexicon('mlmsystem_action_active_blocked'), 'action' => 'activeBlocked', 'button' => false, 'menu' => true);
} else {
$array['actions'][] = array('cls' => '', 'icon' => "{$icon} {$icon}-unlock green", 'title' => $this->modx->lexicon('mlmsystem_action_inactive_blocked'), 'action' => 'inactiveBlocked', 'button' => false, 'menu' => true);
}
if (!$array['leader']) {
$array['actions'][] = array('cls' => '', 'icon' => "{$icon} {$icon}-shield green", 'title' => $this->modx->lexicon('mlmsystem_action_active_leader'), 'action' => 'activeLeader', 'button' => false, 'menu' => true);
} else {
$array['actions'][] = array('cls' => '', 'icon' => "{$icon} {$icon}-shield red", 'title' => $this->modx->lexicon('mlmsystem_action_inactive_leader'), 'action' => 'inactiveLeader', 'button' => false, 'menu' => true);
}
// Remove
$array['actions'][] = array('cls' => '', 'icon' => "{$icon} {$icon}-trash-o red", 'title' => $this->modx->lexicon('mlmsystem_action_remove'), 'action' => 'remove', 'button' => false, 'menu' => true);
return $array;
}
开发者ID:vgrish,项目名称:mlmsystem,代码行数:31,代码来源:getlist.class.php
示例14: prepareRow
/**
* @param xPDOObject $object
*
* @return array
*/
public function prepareRow(xPDOObject $object)
{
$icon = 'fa';
$array = $object->toArray();
$array['actions'] = array();
// Edit
/*$array['actions'][] = array(
'cls' => '',
'icon' => "$icon $icon-eye green",
'title' => $this->modx->lexicon('gl_action_view'),
'action' => 'update',
'button' => true,
'menu' => true,
);*/
if (!$array['active']) {
$array['actions'][] = array('cls' => '', 'icon' => "{$icon} {$icon}-toggle-off red", 'title' => $this->modx->lexicon('gl_action_active'), 'action' => 'active', 'button' => true, 'menu' => true);
} else {
$array['actions'][] = array('cls' => '', 'icon' => "{$icon} {$icon}-toggle-on green", 'title' => $this->modx->lexicon('gl_action_inactive'), 'action' => 'inactive', 'button' => true, 'menu' => true);
}
// sep
$array['actions'][] = array('cls' => '', 'icon' => '', 'title' => '', 'action' => 'sep', 'button' => false, 'menu' => true);
// Remove
$array['actions'][] = array('cls' => '', 'icon' => "{$icon} {$icon}-trash-o red", 'title' => $this->modx->lexicon('gl_action_remove'), 'action' => 'remove', 'button' => true, 'menu' => true);
return $array;
}
开发者ID:ViieeS,项目名称:gl,代码行数:30,代码来源:getlist.class.php
示例15: prepareRow
public function prepareRow(xPDOObject $object)
{
$a = $object->toArray('', false, true);
$a['runs'] = $this->modx->getCount('sTaskRun', array('task' => $a['id']));
$a['data'] = !empty($a['data']) ? $this->modx->toJSON($a['data']) : '';
return $a;
}
开发者ID:sebastian-marinescu,项目名称:Scheduler,代码行数:7,代码来源:getlist.class.php
示例16: prepareRow
public function prepareRow(xPDOObject $object)
{
$charset = $this->modx->getOption('modx_charset', null, 'UTF-8');
$objectArray = $object->toArray();
$resourceArray['pagetitle'] = htmlentities($objectArray['pagetitle'], ENT_COMPAT, $charset);
return $objectArray;
}
开发者ID:semencov-com,项目名称:affiliate,代码行数:7,代码来源:getlist.class.php
示例17: prepareRow
/**
* @param xPDOObject|modAccessResourceGroup $object
* @return array
*/
public function prepareRow(xPDOObject $object)
{
$objectArray = $object->toArray();
if (empty($objectArray['name'])) {
$objectArray['name'] = '(' . $this->modx->lexicon('none') . ')';
}
$objectArray['authority_name'] = !empty($objectArray['role_name']) ? $objectArray['role_name'] . ' - ' . $objectArray['authority'] : $objectArray['authority'];
/* get permissions list */
$data = $objectArray['policy_data'];
unset($objectArray['policy_data']);
$data = $this->modx->fromJSON($data);
if (!empty($data)) {
$permissions = array();
foreach ($data as $perm => $v) {
$permissions[] = $perm;
}
$objectArray['permissions'] = implode(', ', $permissions);
}
$cls = '';
if (($objectArray['target'] == 'web' || $objectArray['target'] == 'mgr') && $objectArray['policy_name'] == 'Administrator' && ($this->userGroup && $this->userGroup->get('name') == 'Administrator')) {
} else {
$cls .= 'pedit premove';
}
$objectArray['cls'] = $cls;
$objectArray['menu'] = array(array('text' => $this->modx->lexicon('access_rgroup_update'), 'handler' => 'this.updateAcl'), '-', array('text' => $this->modx->lexicon('access_rgroup_remove'), 'handler' => 'this.confirm.createDelegate(this,["remove"])'));
return $objectArray;
}
开发者ID:e-gob,项目名称:apps.gob.cl,代码行数:31,代码来源:getlist.class.php
示例18: prepareRow
public function prepareRow(xPDOObject $object)
{
$fields = array_map('trim', explode(',', $this->modx->getOption('ms2_order_product_fields', null, '')));
$fields = array_values(array_unique(array_merge($fields, array('id', 'product_id', 'product_pagetitle'))));
$data = array();
foreach ($fields as $v) {
$data[$v] = $object->get($v);
if ($v == 'product_price' || $v == 'product_old_price') {
$data[$v] = round($data[$v], 2);
} else {
if ($v == 'product_weight') {
$data[$v] = round($data[$v], 3);
}
}
}
$options = $object->get('options');
if (!empty($options) && is_array($options)) {
$tmp = array();
foreach ($options as $k => $v) {
$tmp[] = $this->modx->lexicon('ms2_' . $k) . ': ' . $v;
$data['option_' . $k] = $v;
}
$data['options'] = implode('; ', $tmp);
}
return $data;
}
开发者ID:bendasvadim,项目名称:miniShop2,代码行数:26,代码来源:getlist.class.php
示例19: prepareRow
/**
* Prepare the row for iteration
* @param xPDOObject $object
* @return array
*/
public function prepareRow(xPDOObject $object)
{
$objectArray = $object->toArray();
$objectArray['usergroups'] = '';
if (!empty($objectArray['user_id'])) {
$userObj = $this->modx->getObject('modUser', $objectArray['user_id']);
if ($userObj) {
$usergroups = $userObj->getUserGroupNames();
if ($usergroups) {
$objectArray['usergroups'] = @implode(',', $usergroups);
}
}
}
$subscribersHasCategories = $object->getMany('vnewsSubscribersHasCategories');
$objectArray['categories'] = '';
if ($subscribersHasCategories) {
$categories = array();
foreach ($subscribersHasCategories as $subsHasCats) {
$category = $subsHasCats->getOne('vnewsCategories');
$categories[] = $category->get('name');
}
$objectArray['categories'] = @implode(',', $categories);
}
return $objectArray;
}
开发者ID:ksneo,项目名称:virtuNewsletter,代码行数:30,代码来源:getlist.class.php
示例20: prepareRow
/**
* Convert category ID to category name for objects with a category.
* Convert template ID to template name for objects with a template
*
* Note: It's much more efficient to do these with a join, but that can
* only be done for objects known to have the field. This code can
* be used on any object.
*
* @param xPDOObject $object
* @return array
*/
public function prepareRow(xPDOObject $object)
{
$fields = $object->toArray();
if (array_key_exists('category', $fields)) {
if (!empty($fields['category'])) {
$categoryObj = $this->modx->getObject('modCategory', $fields['category']);
if ($categoryObj) {
$fields['category'] = $categoryObj->get('category');
} else {
$fields['category'] = $this->modx->lexicon('invalid_category');
}
} else {
$fields['category'] = $this->modx->lexicon('none');
}
}
if (array_key_exists('template', $fields)) {
if (!empty($fields['template'])) {
$templateObj = $this->modx->getObject('modTemplate', $fields['template']);
if ($templateObj) {
$fields['template'] = $templateObj->get('category');
} else {
$fields['template'] = $this->modx->lexicon('invalid_template');
}
} else {
$fields['template'] = $this->modx->lexicon('none');
}
}
return $fields;
}
开发者ID:Piterden,项目名称:modx_testfloor,代码行数:40,代码来源:getlist.class.php
注:本文中的xPDOObject类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论