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


PHP Field::prepareTableValue方法代码示例

本文整理汇总了PHP中Field::prepareTableValue方法的典型用法代码示例。如果您正苦于以下问题:PHP Field::prepareTableValue方法的具体用法?PHP Field::prepareTableValue怎么用?PHP Field::prepareTableValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Field的用法示例。


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

示例1: prepareTableValue

 function prepareTableValue($data, XMLElement $link = NULL)
 {
     $result = array();
     if (!is_array($data) || is_array($data) && !isset($data['relation_id'])) {
         return parent::prepareTableValue(NULL);
     }
     if (!is_array($data['relation_id'])) {
         $data['relation_id'] = array($data['relation_id']);
     }
     foreach ($data['relation_id'] as $relation_id) {
         if ((int) $relation_id <= 0) {
             continue;
         }
         $primary_field = $this->__findPrimaryFieldValueFromRelationID($relation_id);
         if (!is_array($primary_field) || empty($primary_field)) {
             continue;
         }
         $result[$relation_id] = $primary_field;
     }
     if (!is_null($link)) {
         $label = NULL;
         foreach ($result as $item) {
             $label .= ' ' . $item['value'];
         }
         $link->setValue(General::sanitize(trim($label)));
         return $link->generate();
     }
     $output = NULL;
     foreach ($result as $relation_id => $item) {
         $link = Widget::Anchor($item['value'], sprintf('%s/symphony/publish/%s/edit/%d/', URL, $item['section_handle'], $relation_id));
         $output .= $link->generate() . ' ';
     }
     return trim($output);
 }
开发者ID:bauhouse,项目名称:sym-spectrum,代码行数:34,代码来源:field.selectbox_link.php

示例2: prepareTableValue

 function prepareTableValue($data, XMLElement $link = NULL)
 {
     if (!is_array($data) || is_array($data) && !isset($data['relation_id'])) {
         return parent::prepareTableValue(NULL);
     }
     $link = Widget::Anchor($data['value'], URL . '/symphony/extension/nested_cats/overview/edit/' . $data['relation_id']);
     return $link;
 }
开发者ID:bauhouse,项目名称:sym-extensions,代码行数:8,代码来源:field.nested_cats.php

示例3: prepareTableValue

 public function prepareTableValue($data, XMLElement $link = NULL)
 {
     if (!is_array($data) || is_array($data) && !isset($data['relation_id'])) {
         return parent::prepareTableValue(NULL);
     }
     if (!is_array($data['relation_id'])) {
         $data['relation_id'] = array($data['relation_id']);
         $data['value'] = array($data['value']);
         $data['handle'] = array($data['handle']);
     }
     $output = NULL;
     foreach ($data['relation_id'] as $k => $v) {
         $link = Widget::Anchor($data['value'][$k], URL . '/symphony/extension/nestedcats/list/view/' . $data['relation_id'][$k]);
         $output .= $link->generate() . ' ';
     }
     return trim($output);
 }
开发者ID:andrrr,项目名称:nestedcats,代码行数:17,代码来源:field.nestedcats.php

示例4: prepareTableValue

 public function prepareTableValue($data, XMLElement $link = NULL, $entry_id = NULL)
 {
     // build this entry fully
     $entries = EntryManager::fetch($entry_id);
     if ($entries === false) {
         return parent::prepareTableValue(NULL, $link, $entry_id);
     }
     $entry = reset(EntryManager::fetch($entry_id));
     // get the first field inside this tab
     $field_id = Symphony::Database()->fetchVar('id', 0, "SELECT `id` FROM `tbl_fields` WHERE `parent_section` = '" . $this->get('parent_section') . "' AND `sortorder` = " . ($this->get('sortorder') + 1) . " ORDER BY `sortorder` LIMIT 1");
     if ($field_id === NULL) {
         return parent::prepareTableValue(NULL, $link, $entry_id);
     }
     $field = FieldManager::fetch($field_id);
     // get the first field's value as a substitude for the tab's return value
     return $field->prepareTableValue($entry->getData($field_id), $link, $entry_id);
 }
开发者ID:henrysingleton,项目名称:publish_tabs,代码行数:17,代码来源:field.publish_tabs.php

示例5: prepareTableValue

 function prepareTableValue($data, XMLElement $link = NULL)
 {
     if (!is_array($data) || empty($data)) {
         return;
     }
     $value = NULL;
     if (isset($data['username']) && !is_array($data['username'])) {
         $data['username'] = array($data['username']);
         $data['member_id'] = array($data['member_id']);
     }
     if (!is_null($link)) {
         return parent::prepareTableValue(array('value' => @implode(', ', $data['username']), $link));
     }
     foreach ($data['username'] as $index => $username) {
         $a = Widget::Anchor($username, URL . '/symphony/publish/' . self::$_driver->memberSectionHandle() . '/edit/' . $data['member_id'][$index] . '/', "Edit Member '{$username}'");
         $value .= $a->generate() . ', ';
     }
     return trim($value, ', ');
 }
开发者ID:bauhouse,项目名称:members,代码行数:19,代码来源:field.memberlink.php

示例6: prepareTableValue

 function prepareTableValue($data, XMLElement $link = NULL)
 {
     return parent::prepareTableValue(array('value' => $data['username']), $link);
 }
开发者ID:klaftertief,项目名称:members-legacy,代码行数:4,代码来源:field.member.php

示例7: prepareTableValue

 public function prepareTableValue($data, XMLElement $link = NULL, $entry_id = null)
 {
     $value = null;
     if (isset($data['value'])) {
         $value = DateTimeObj::format($data['value'], DateTimeObj::getSetting('datetime_format'), true);
     }
     return parent::prepareTableValue(array('value' => $value), $link, $entry_id = null);
 }
开发者ID:davjand,项目名称:codecept-symphonycms-db,代码行数:8,代码来源:field.date.php

示例8: prepareTableValue

 public function prepareTableValue($data, XMLElement $link = NULL, $entry_id = null)
 {
     if (!is_array($data) || empty($data)) {
         return;
     }
     $value = NULL;
     if (isset($data['value'])) {
         $value = is_array($data['value']) ? self::__tagArrayToString($data['value']) : $data['value'];
     }
     return parent::prepareTableValue(array('value' => General::sanitize($value)), $link, $entry_id = null);
 }
开发者ID:nickdunn,项目名称:elasticsearch-surfin-shakespeare,代码行数:11,代码来源:field.taglist.php

示例9: prepareTableValue

 public function prepareTableValue($data, XMLElement $link = NULL, $entry_id = null)
 {
     $value = $this->prepareExportValue($data, ExportableField::LIST_OF + ExportableField::VALUE, $entry_id);
     return parent::prepareTableValue(array('value' => implode(', ', $value)), $link, $entry_id = null);
 }
开发者ID:readona,项目名称:symphonyno5,代码行数:5,代码来源:field.select.php

示例10: prepareTableValue

 public function prepareTableValue($data, DOMElement $link = NULL)
 {
     if (!is_array($data)) {
         $data = array($data);
     }
     $values = array();
     foreach ($data as $d) {
         $values[] = $d->value;
     }
     return parent::prepareTableValue((object) array('value' => implode(', ', $values)), $link);
 }
开发者ID:pointybeard,项目名称:symphony-3,代码行数:11,代码来源:field.select.php

示例11: prepareTableValue

 public function prepareTableValue($data, XMLElement $link = null, $entry_id = null)
 {
     $selected = array_map('trim', explode(',', $data['value']));
     $options = Extension_Languages::findOptions();
     $value = array();
     foreach ($selected as $code) {
         foreach ($options as $details) {
             if ($details[0] == $code) {
                 $value[] = $details[2];
                 break;
             }
         }
     }
     $value = implode(', ', $value);
     return parent::prepareTableValue(array('value' => $value), $link, $entry_id);
 }
开发者ID:siimsoni,项目名称:languages,代码行数:16,代码来源:field.languages.php

示例12: prepareTableValue

 public function prepareTableValue($data, XMLElement $link = NULL, $entry_id = null)
 {
     if (!($file = $data['file'])) {
         if ($link) {
             return parent::prepareTableValue(null, $link);
         } else {
             return parent::prepareTableValue(null);
         }
     }
     if ($link) {
         $link->setValue(basename($file));
         return $link->generate();
     } else {
         $link = Widget::Anchor(basename($file), URL . '/workspace' . $file);
         return $link->generate();
     }
 }
开发者ID:bauhouse,项目名称:Piano-Sonata,代码行数:17,代码来源:field.upload.php

示例13: prepareTableValue

 public function prepareTableValue(StdClass $data = null, DOMElement $wrapper = null, Entry $entry = null)
 {
     $result = (object) array('value' => null);
     if (isset($data->joined_id)) {
         try {
             $document = $wrapper->ownerDocument;
             $driver = Extension::load('field_join');
             $driver->addPublishHeaders($document);
             $joined = Entry::loadFromId($data->joined_id);
             $section = Section::loadFromHandle($joined->section);
             $wrapper->addClass('field-join');
             $wrapper->setValue($section->name);
             /*
             $more = $document->createElement('span');
             $more->addClass('more');
             $more->setValue(__('More'));
             $wrapper->appendChild($more);
             
             // Build data array:
             $content = $document->createElement('div');
             $more->appendChild($content);
             
             foreach ($section->layout as $column) {
             	foreach ($column->fieldsets as $fieldset) {
             		$group = $document->createElement('div');
             		$group->addClass('list');
             		$content->appendChild($group);
             		
             		if ($fieldset->name) $group->appendChild(
             			$document->createElement('h5', $fieldset->name)
             		);
             		
             		$list = $document->createElement('dl');
             		$group->appendChild($list);
             		
             		foreach ($fieldset->fields as $field_handle) {
             			$field = $section->fetchFieldByHandle($field_handle);
             			
             			$title = $document->createElement('dt', $field->{'publish-label'});
             			$list->appendChild($title);
             			$item = $document->createElement('dd');
             			$list->appendChild($item);
             			
             			$value = $field->prepareTableValue(
             				$joined->data()->{$field_handle},
             				$item, $joined
             			);
             		}
             	}
             }
             */
             return $wrapper;
         } catch (Exception $e) {
             // Keep the null value set above.
         }
     }
     return parent::prepareTableValue($result, $link, $entry);
 }
开发者ID:symphonycms,项目名称:symphony-3,代码行数:58,代码来源:field.join.php

示例14: prepareTableValue

 public function prepareTableValue($data, XMLElement $link = null)
 {
     if (empty($data)) {
         return;
     }
     $value = '';
     if (isset($data['value'])) {
         if (!is_array($data['value'])) {
             $data['value'] = array($data['value']);
         }
         $value = implode(', ', $data['value']);
     }
     return parent::prepareTableValue(array('value' => General::sanitize(strip_tags($value))), $link);
 }
开发者ID:psychoticmeowArchives,项目名称:checklistfield,代码行数:14,代码来源:field.checklist.php

示例15: prepareTableValue

 public function prepareTableValue($data, XMLElement $link = null)
 {
     if (empty($data) or strlen(trim($data['value'])) == 0) {
         return;
     }
     return parent::prepareTableValue(array('value' => General::sanitize($data['compiled'])), $link);
 }
开发者ID:bauhouse,项目名称:sym-extensions,代码行数:7,代码来源:field.expression.php


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