本文整理汇总了PHP中Utils_RecordBrowserCommon::create_linked_label方法的典型用法代码示例。如果您正苦于以下问题:PHP Utils_RecordBrowserCommon::create_linked_label方法的具体用法?PHP Utils_RecordBrowserCommon::create_linked_label怎么用?PHP Utils_RecordBrowserCommon::create_linked_label使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Utils_RecordBrowserCommon
的用法示例。
在下文中一共展示了Utils_RecordBrowserCommon::create_linked_label方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_val
//.........这里部分代码省略.........
if (count($path) > 1) {
$res .= Utils_CommonDataCommon::get_value($col . '/' . $path[0], true);
if (count($path) > 2) {
$res .= $commondata_sep . '...';
$tooltip = '';
$full_path = $col;
foreach ($path as $w) {
$full_path .= '/' . $w;
$tooltip .= ($tooltip ? $commondata_sep : '') . Utils_CommonDataCommon::get_value($full_path, true);
}
}
$res .= $commondata_sep;
}
$val = Utils_CommonDataCommon::get_value($col . '/' . $v, true);
if (!$val) {
continue;
}
$res .= $val;
if ($first) {
$first = false;
} else {
$ret .= '<br>';
}
$res = self::no_wrap($res);
if ($tooltip) {
$res = '<span ' . Utils_TooltipCommon::open_tag_attrs($tooltip, false) . '>' . $res . '</span>';
}
$ret .= $res;
} else {
if (!$single_tab) {
list($tab, $v) = explode('/', $v, 2);
}
if ($first) {
$first = false;
} else {
$ret .= '<br>';
}
if ($col) {
$columns = explode('|', $col);
$ret .= Utils_RecordBrowserCommon::create_linked_label($tab, $columns, $v, $links_not_recommended);
} else {
$ret .= Utils_RecordBrowserCommon::create_default_linked_label($tab, $v, $links_not_recommended);
}
}
}
if ($ret == '') {
$ret = '---';
}
} elseif ($args['type'] == 'commondata') {
if (!isset($val) || $val === '') {
$ret = '';
} else {
$arr = explode('::', $args['param']['array_id']);
$path = array_shift($arr);
foreach ($arr as $v) {
$path .= '/' . $record[self::get_field_id($v)];
}
$path .= '/' . $record[$args['id']];
$ret = Utils_CommonDataCommon::get_value($path, true);
}
/* } elseif ($args['type']=='record') {
if (!isset($val) || $val==='') {
$ret = '';
} else {
@list($rs,$rid) = explode('#',$record[$args['id']],2);
if(!$rid) $ret = '';
else {
$ret = self::create_default_linked_label($rs,$rid,$links_not_recommended);
}
}*/
} elseif ($args['type'] == 'autonumber') {
if (!$links_not_recommended && isset($record['id']) && $record['id']) {
$ret = self::record_link_open_tag_r($tab, $record) . $val . self::record_link_close_tag();
}
} elseif ($args['type'] == 'currency') {
$val = Utils_CurrencyFieldCommon::get_values($val);
$ret = Utils_CurrencyFieldCommon::format($val[0], $val[1]);
} elseif ($args['type'] == 'checkbox') {
$ret = $ret ? __('Yes') : __('No');
} elseif ($args['type'] == 'date') {
if ($val != '') {
$ret = Base_RegionalSettingsCommon::time2reg($val, false, true, false);
}
} elseif ($args['type'] == 'timestamp') {
if ($val != '') {
$ret = Base_RegionalSettingsCommon::time2reg($val, 'without_seconds');
}
} elseif ($args['type'] == 'time') {
if ($val != '') {
$ret = Base_RegionalSettingsCommon::time2reg($val, 'without_seconds', false);
}
} elseif ($args['type'] == 'long text') {
$ret = htmlspecialchars($val);
$ret = str_replace("\n", '<br>', $ret);
$ret = Utils_BBCodeCommon::parse($ret);
}
}
unset($recurrence_call_stack[$function_call_id]);
return $ret;
}
示例2: create_linked_label
/**
* Create linked label with text values from fields.
* @param string|array $field Fields' ids list. In array or string separated
* by '|'. e.g. array('first_name', 'last_name') or 'first_name|last_name'.
* @param int $id Record's ID
* @param bool $nolink Do not create link
* @return string html with link
*/
public function create_linked_label($field, $id, $nolink = false)
{
return Utils_RecordBrowserCommon::create_linked_label($this->tab, $field, $id, $nolink);
}
示例3: display_company
public static function display_company($record, $nolink = false, $desc = null)
{
if ($desc !== null) {
$v = $record[$desc['id']];
} elseif (is_array($record)) {
$v = $record['id'];
} else {
$v = $record;
}
if (!is_numeric($v) && !is_array($v)) {
return $v;
}
if ($v == -1) {
return '---';
}
$def = '';
$first = true;
if (!is_array($v)) {
$v = array($v);
}
foreach ($v as $k => $w) {
if ($w == '') {
break;
}
if ($first) {
$first = false;
} else {
$def .= '<br>';
}
$def .= Utils_RecordBrowserCommon::no_wrap(Utils_RecordBrowserCommon::create_linked_label('company', 'Company Name', $w, $nolink));
}
if (!$def) {
return '---';
}
return $def;
}
示例4: queue_tab
public function queue_tab($count_f, $get_f, $statuses)
{
$t = time();
$status =& $this->get_module_variable('queue_status', current(array_keys($statuses)));
$offset =& $this->get_module_variable('queue_offset', 0);
$form = $this->init_module(Libs_QuickForm::module_name());
$theme = $this->pack_module(Base_Theme::module_name());
$form->addElement('select', 'status', __('Status'), $statuses);
$form->addElement('submit', 'submit_button', __('Show'));
$form->addRule('status', 'Field required', 'required');
$form->setDefaults(array('status' => $status));
if ($form->validate()) {
$data = $form->exportValues();
if (array_key_exists($data['status'], $statuses)) {
$status = $data['status'];
}
$offset = 0;
}
$form->assign_theme('form', $theme);
$m = $this->init_module(Utils_GenericBrowser::module_name(), null, 'queue');
$m->set_table_columns(array(array('name' => 'To', 'width' => 30, 'order' => 'toNumber'), array('name' => 'Status', 'width' => 10), array('name' => 'Date', 'width' => 10, 'order' => 'creationDate'), array('name' => 'File', 'width' => 30, 'order' => 'fileName')));
$m->set_default_order(array('Date' => 'DESC'));
$count = call_user_func($count_f, $status);
if ($count === false) {
$count = 0;
}
$limits = $m->get_limit($count);
$order = $m->get_order();
if ($count != 0) {
$data = call_user_func($get_f, $status, $order[0]['order'], $order[0]['direction'], $limits['numrows'], (string) ($limits['offset'] + 1));
}
if ($count == 0 || $data === false) {
$data = array();
}
foreach ($data as $row) {
$from_rec = CRM_ContactsCommon::get_contacts(array('fax' => $row['toNumber']));
foreach ($from_rec as &$rec) {
$rec = CRM_ContactsCommon::contact_format_default($rec);
}
$from_rec_comp = CRM_ContactsCommon::get_companies(array('fax' => $row['toNumber']));
foreach ($from_rec_comp as $rec) {
$from_rec[] = Utils_RecordBrowserCommon::create_linked_label('company', 'Company Name', $rec);
}
$m->add_row(empty($from_rec) ? $row['toNumber'] : ' (' . implode(', ', $from_rec) . ')', $statuses[$row['faxStatus']], Base_RegionalSettingsCommon::time2reg($row['creationDate']), '<a href="' . $row['fileUrl'] . '" target="_blank">' . $row['fileName'] . '</a>');
}
$theme->assign('table_data', $this->get_html_of_module($m));
$theme->display();
}
示例5: display_bugtrack
public static function display_bugtrack($v)
{
return Utils_RecordBrowserCommon::create_linked_label('bugtrack', 'Project Name', $v['id']);
}