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


PHP xPDOObject类代码示例

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


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


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