本文整理汇总了PHP中CsviHelper::recurseArrayDiff方法的典型用法代码示例。如果您正苦于以下问题:PHP CsviHelper::recurseArrayDiff方法的具体用法?PHP CsviHelper::recurseArrayDiff怎么用?PHP CsviHelper::recurseArrayDiff使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CsviHelper
的用法示例。
在下文中一共展示了CsviHelper::recurseArrayDiff方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getCronLine
/**
* Build the command to use for the cron command to do an import/export
*
* @copyright
* @author RolandD
* @todo
* @see
* @access public
* @param
* @return string the parameters for the cron line
* @since 3.0
*/
public function getCronLine()
{
$jinput = JFactory::getApplication()->input;
$db = JFactory::getDbo();
$settings = $jinput->get('com_csvi.data', array(), 'array');
$cronline = '';
$notemplate = false;
$details = new StdClass();
// Get the template used
$template_id = $jinput->get('template_id', 0, 'int');
if ($template_id) {
$cronline .= ' template_id="' . $template_id . '"';
// Load the template settings to compare against selection
$query = $db->getQuery(true);
$query->select('settings');
$query->from('#__csvi_template_settings');
$query->where('id = ' . $template_id);
$db->setQuery($query);
$template = new CsviTemplate(json_decode($db->loadResult(), true));
$details->type = $template->get('action', 'options');
} else {
$notemplate = true;
// Initialise the details
$details->type = $settings['options']['action'];
}
// Check if this is an import or export cron
if ($details->type == 'export') {
foreach ($settings as $group => $values) {
switch ($group) {
case 'options':
break;
case 'general':
if ($notemplate) {
$general = $settings['general'];
} else {
$general = CsviHelper::recurseArrayDiff($settings['general'], $template->get('general'));
}
foreach ($general as $name => $setting) {
switch ($name) {
case 'exportto':
if (!empty($setting)) {
if ($setting == 'todownload') {
$setting = 'tofile';
}
$cronline .= ' jform:general:' . $name . '="' . $setting . '" ';
}
break;
case 'localpath':
if (!empty($setting)) {
if ($template->get('exportto', 'general') == 'todownload' || $template->get('exportto', 'general') == 'tofile') {
$cronline .= ' jform:general:' . $name . '="' . $setting . '" ';
}
}
break;
default:
if (!empty($setting)) {
$cronline .= ' jform:general:' . $name . '="' . $setting . '" ';
}
break;
}
}
break;
case 'export_fields':
if ($notemplate) {
if (array_key_exists('export_fields', $settings)) {
$fields = $settings['export_fields'];
} else {
$fields = array();
}
} else {
$fields = $template->get('export_fields', '', array());
}
if (!empty($fields)) {
$fields['_selected_name'] = CsviHelper::recurseArrayDiff($settings['export_fields']['_selected_name'], $fields['_selected_name']);
if (!empty($fields['_selected_name'])) {
$cronline .= ' jform:export_fields:_selected_name = "' . implode('|', $settings['export_fields']['_selected_name']) . '|"';
$cronline .= ' jform:export_fields:_column_header = "' . implode('|', $settings['export_fields']['_column_header']) . '|"';
$cronline .= ' jform:export_fields:_default_value = "' . implode('|', $settings['export_fields']['_default_value']) . '|"';
$cronline .= ' jform:export_fields:_process_field = "' . implode('|', $settings['export_fields']['_process_field']) . '|"';
}
}
break;
default:
if ($notemplate) {
$values = $settings[$group];
} else {
$values = CsviHelper::recurseArrayDiff($settings[$group], $template->get($group));
}
//.........这里部分代码省略.........