本文整理汇总了PHP中modObjectGetListProcessor类的典型用法代码示例。如果您正苦于以下问题:PHP modObjectGetListProcessor类的具体用法?PHP modObjectGetListProcessor怎么用?PHP modObjectGetListProcessor使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了modObjectGetListProcessor类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: initialize
public function initialize()
{
$initialized = parent::initialize();
$this->setDefaultProperties(array('key' => false, 'namespace' => false, 'area' => false));
$this->dateFormat = $this->modx->getOption('manager_date_format') . ', ' . $this->modx->getOption('manager_time_format');
return $initialized;
}
示例2: outputArray
/** {@inheritDoc} */
public function outputArray(array $array, $count = false)
{
if ($this->getProperty('addall')) {
$array = array_merge_recursive(array(array('id' => 0, 'name' => 'Мсу')), $array);
}
return parent::outputArray($array, $count);
}
示例3: prepareQueryBeforeCount
/**
* @param xPDOQuery $c
*
* @return xPDOQuery
*/
public function prepareQueryBeforeCount(xPDOQuery $c)
{
if ($tid = $this->getProperty('tid')) {
$c->where(array('tid' => $tid));
}
return parent::prepareQueryBeforeCount($c);
}
示例4: initialize
/** {@inheritDoc} */
public function initialize()
{
if (!$this->getProperty('limit')) {
$this->setProperty('limit', 20);
}
return parent::initialize();
}
示例5: prepareRow
/**
* @param xPDOObject $object
*
* @return array
*/
public function prepareRow(xPDOObject $object)
{
$array = parent::prepareRow($object);
if (empty($array['author'])) {
$array['author'] = $array['username'];
}
$this->modx->getContext($array['context_key']);
$array['preview_url'] = $this->modx->makeUrl($array['id'], $array['context_key']);
$icon = $this->_modx23 ? 'icon' : 'fa';
$array['actions'] = array();
// View
if (!empty($array['preview_url'])) {
$array['actions'][] = array('cls' => '', 'icon' => "{$icon} {$icon}-eye", 'title' => $this->modx->lexicon('tickets_action_view'), 'action' => 'viewTicket', 'button' => true, 'menu' => true);
}
// Edit
$array['actions'][] = array('cls' => '', 'icon' => "{$icon} {$icon}-edit", 'title' => $this->modx->lexicon('tickets_action_edit'), 'action' => 'editTicket', 'button' => false, 'menu' => true);
// Duplicate
$array['actions'][] = array('cls' => '', 'icon' => "{$icon} {$icon}-files-o", 'title' => $this->modx->lexicon('tickets_action_duplicate'), 'action' => 'duplicateTicket', 'button' => false, 'menu' => true);
// Publish
if (!$array['published']) {
$array['actions'][] = array('cls' => '', 'icon' => "{$icon} {$icon}-power-off action-green", 'title' => $this->modx->lexicon('tickets_action_publish'), 'multiple' => $this->modx->lexicon('tickets_action_publish'), 'action' => 'publishTicket', 'button' => true, 'menu' => true);
} else {
$array['actions'][] = array('cls' => '', 'icon' => "{$icon} {$icon}-power-off action-gray", 'title' => $this->modx->lexicon('tickets_action_unpublish'), 'multiple' => $this->modx->lexicon('tickets_action_unpublish'), 'action' => 'unpublishTicket', 'button' => true, 'menu' => true);
}
// Delete
if (!$array['deleted']) {
$array['actions'][] = array('cls' => '', 'icon' => "{$icon} {$icon}-trash-o action-red", 'title' => $this->modx->lexicon('tickets_action_delete'), 'multiple' => $this->modx->lexicon('tickets_action_delete'), 'action' => 'deleteTicket', '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' => 'undeleteTicket', 'button' => true, 'menu' => true);
}
// Menu
$array['actions'][] = array('cls' => '', 'icon' => "{$icon} {$icon}-cog actions-menu", 'menu' => false, 'button' => true, 'action' => 'showMenu', 'type' => 'menu');
return $array;
}
示例6: initialize
public function initialize()
{
$this->setDefaultProperties(array('profile' => 0, 'search' => ''));
$this->canEdit = $this->modx->hasPermission('save');
$this->canRemove = $this->modx->hasPermission('remove');
return parent::initialize();
}
示例7: prepareQueryBeforeCount
public function prepareQueryBeforeCount(xPDOQuery $c)
{
$c->leftJoin($this->classKey, 'Children');
$c->where(array($this->classKey . '.parent' => $this->getProperty('id')));
$c->groupby($this->classKey . '.text');
return parent::prepareQueryBeforeCount($c);
}
示例8: prepareRow
/**
* Prepare the row for iteration
* @param xPDOObject $object
* @return array
*/
public function prepareRow(xPDOObject $object)
{
$resourceArray = parent::prepareRow($object);
foreach ($resourceArray as $field => $value) {
if (!in_array($field, array('id', 'pagetitle', 'published', 'deleted', 'hidemenu', 'isfolder', 'publishedon', 'context_key', 'properties'))) {
unset($resourceArray[$field]);
continue;
}
// avoid null on returns
$resourceArray[$field] = $resourceArray[$field] !== null ? $resourceArray[$field] : '';
}
$settings = $object->getProperties('gridclasskey');
if (is_array($settings) && !empty($settings)) {
foreach ($settings as $k => $v) {
$resourceArray['gridclasskey-property-' . $k] = $v;
}
}
if (isset($resourceArray['publishedon'])) {
$publishedon = strtotime($resourceArray['publishedon']);
$resourceArray['publishedon_date'] = strftime($this->modx->getOption('gridclasskey.mgr_date_format', null, '%b %d'), $publishedon);
$resourceArray['publishedon_time'] = strftime($this->modx->getOption('gridclasskey.mgr_time_format', null, '%H:%I %p'), $publishedon);
$resourceArray['publishedon'] = strftime('%b %d, %Y %H:%I %p', $publishedon);
}
$resourceArray['action_edit'] = '?a=' . $this->editAction . '&id=' . $resourceArray['id'];
$this->modx->getContext($resourceArray['context_key']);
$resourceArray['preview_url'] = $this->modx->makeUrl($resourceArray['id'], $resourceArray['context_key'], null, 'full');
$c = $this->modx->newQuery('modResource');
$c->where(array('parent' => $resourceArray['id']));
$c->limit(1);
$resourceArray['has_children'] = (bool) $this->modx->getCount('modResource', $c);
return $resourceArray;
}
示例9: initialize
/** {@inheritDoc} */
public function initialize()
{
if (!$this->modx->hasPermission($this->permission)) {
return $this->modx->lexicon('access_denied');
}
return parent::initialize();
}
示例10: 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;
}
示例11: outputArray
/** {@inheritDoc} */
public function outputArray(array $array, $count = false)
{
if ($this->getProperty('addall')) {
$array = array_merge_recursive(array(array('id' => 0, 'name' => $this->modx->lexicon('mlmsystem_all'))), $array);
}
return parent::outputArray($array, $count);
}
示例12: initialize
/**
* @return bool
*/
public function initialize()
{
$parent = parent::initialize();
/** @var msDiscount $msDiscount */
$msDiscount = $this->modx->getService('msDiscount');
$this->_modx23 = $msDiscount->systemVersion();
return $parent;
}
示例13: initialize
public function initialize()
{
$this->editAction = $this->modx->getObject('modAction', array('namespace' => 'core', 'controller' => 'resource/update'));
if (!$this->getProperty('limit')) {
$this->setProperty('limit', 20);
}
return parent::initialize();
}
示例14: beforeQuery
public function beforeQuery()
{
$tagId = (int) $this->getProperty('tagId');
if (empty($tagId) || $tagId == 0) {
return $this->modx->lexicon('tagger.err.tag_assigned_resources_tag_ns');
}
return parent::beforeQuery();
}
示例15: initialize
/**
* {@inheritDoc}
* @return boolean
*/
public function initialize()
{
$props = $this->getProperties();
if (empty($props['contexts'])) {
return $this->modx->lexicon($this->objectType . '_err_ns');
}
return parent::initialize();
}