本文整理汇总了PHP中JUDirectoryHelper::hasCSVPlugin方法的典型用法代码示例。如果您正苦于以下问题:PHP JUDirectoryHelper::hasCSVPlugin方法的具体用法?PHP JUDirectoryHelper::hasCSVPlugin怎么用?PHP JUDirectoryHelper::hasCSVPlugin使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JUDirectoryHelper
的用法示例。
在下文中一共展示了JUDirectoryHelper::hasCSVPlugin方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
?>
/administrator/components/com_judirectory/assets/img/icon/address.png" />
<span><?php
echo JText::_('COM_JUDIRECTORY_DASHBOARD_ADDRESSES');
?>
</span>
</a>
</div>
</div>
</div>
<?php
}
?>
<?php
if (JUDirectoryHelper::checkGroupPermission(null, "csvprocess") && JUDirectoryHelper::hasCSVPlugin()) {
?>
<div class="cpanel">
<div class="icon-wrapper">
<div class="icon">
<a href="<?php
echo JRoute::_('index.php?option=com_judirectory&view=csvprocess');
?>
">
<img alt="<?php
echo JText::_('COM_JUDIRECTORY_DASHBOARD_CSV');
?>
" src="<?php
echo JUri::root(true);
?>
/administrator/components/com_judirectory/assets/img/icon/csv.png" />
示例2: getExportData
public function getExportData($exportColumns, $filter)
{
$exportData = array();
$start = 0;
$limit = 0;
if (isset($filter['csv_limit_export']) && $filter['csv_limit_export']) {
if (strpos($filter['csv_limit_export'], ',') !== false) {
list($start, $limit) = explode(',', $filter['csv_limit_export']);
} else {
$limit = (int) $filter['csv_limit_export'];
}
}
if (JUDirectoryHelper::hasCSVPlugin()) {
$JUDirectoryCsv = new JUDirectoryCSV($this);
$listings = $JUDirectoryCsv->getListings($exportColumns, $filter, $start, $limit);
}
if (!empty($listings)) {
foreach ($listings as $listing) {
$data = array();
foreach ($exportColumns as $exportColumn) {
if (is_numeric($exportColumn)) {
$field = JUDirectoryFrontHelperField::getField($exportColumn, $listing);
if ($field && $field->canExport()) {
$data[$field->getCaption(true) . ' [' . $field->id . ']'] = $field->onExport();
}
} elseif (isset($listing->{$exportColumn})) {
$data[$exportColumn] = $listing->{$exportColumn};
}
}
if (in_array('related_listings', $exportColumns)) {
$data['related_listings'] = $listing->related_listings;
}
$exportData[] = $data;
}
}
$columns = array_keys($exportData[0]);
array_unshift($exportData, $columns);
return $exportData;
}