Back to PhocacartRenderAdmincolumns class

Method title

public
title
(mixed $item, mixed &$options)

Method title - Source code

/*
 * $item['params']['edit'] ... defined by user in Phoca Cart options: to display title: "title", to display editable title: "title=E"
 * $item['canedit'] ... defined by Joomla! permissions system
 */
public function title($item, &$options)
{
    $paramsC = PhocacartUtils::getComponentParameters();
    $admin_eip_title = $paramsC->get('admin_eip_title', 4);
    $o = array();
    if ($item['checked_out']) {
        $o[] = HTMLHelper::_('jgrid.checkedout', $item['i'], $item['editor'], $item['checked_out_time'], $options['tasks'] . '.', $item['cancheckin']);
    }
    if ($item['params']['edit'] && ($item['cancreate'] || $item['canedit'])) {
        $o[] = '<span class="ph-editinplace-text ph-eip-' . $item['editclass'] . ' ph-eip-' . $item['name'] . ' phIdTitle' . (int) $item['id'] . '" id="' . $item['idtoken'] . '">' . PhocacartText::filterValue($item['value'], 'text') . '</span>';
        if ($admin_eip_title == 3 || $admin_eip_title == 4) {
            $o[] = '<span class="ph-editinplace-text ph-eip-' . $item['editclass'] . ' ph-eip-' . $item['namealias'] . '" id="' . $item['idtokencombined'] . '">' . PhocacartText::filterValue($item['valuealias'], 'text') . '</span>';
        }
    } else {
        if (!$item['params']['edit'] && ($item['cancreate'] || $item['canedit'])) {
            if (isset($item['linkeditbox']) && $item['linkeditbox'] != '') {
                $o[] = $item['linkeditbox'];
            } else {
                $o[] = '<a href="' . Route::_($item['linkedit']) . '"><span id="phIdTitle' . (int) $item['id'] . '" class="ph-' . $item['name'] . ' phIdTitle' . (int) $item['id'] . '">' . PhocacartText::filterValue($item['value'], 'text') . '</span></a>';
            }
            $o[] = '<br /><span class="smallsub">(<span>' . Text::_('COM_PHOCACART_FIELD_ALIAS_LABEL') . ':</span>' . PhocacartText::filterValue($item['valuealias'], 'text') . ')</span>';
        } else {
            // Class phIdTitle needed for displaying Copy Attributes Titles
            $o[] = '<span id="phIdTitle' . (int) $item['id'] . '" class="ph-' . $item['name'] . ' phIdTitle' . (int) $item['id'] . '">' . PhocacartText::filterValue($item['value'], 'text') . '</span>';
            $o[] = '<br /><span class="smallsub">(<span>' . Text::_('COM_PHOCACART_FIELD_FIELD_ALIAS_LABEL') . ':</span>' . PhocacartText::filterValue($item['valuealias'], 'text') . ')</span>';
        }
    }
    return $this->r->td(implode("\n", $o), 'small');
}