本文整理汇总了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);
}
示例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;
}
示例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);
}
示例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);
}
示例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, ', ');
}
示例6: prepareTableValue
function prepareTableValue($data, XMLElement $link = NULL)
{
return parent::prepareTableValue(array('value' => $data['username']), $link);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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();
}
}
示例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);
}
示例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);
}
示例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);
}