function classified_context_condition_path::condition_form in Classified Ads 6.3
Same name and namespace in other branches
- 7.3 plugins/classified_context_condition_path.inc \classified_context_condition_path::condition_form()
Condition form.
Return value
array A form array for the condition.
File
- plugins/
classified_context_condition_path.inc, line 43 - A plugin automatically declaring the set of paths of the Classified Ads module as context path conditions
Class
- classified_context_condition_path
- Merge Classified Ads paths within a Context path condition.
Code
function condition_form($context) {
$form = array();
$form['1'] = parent::condition_form($context);
$all_paths = explode("\n", $form['1']['#default_value']);
$classified_paths = $this
->get_classified_paths();
sort($classified_paths);
$common_paths = array_values(array_intersect($all_paths, $classified_paths));
sort($common_paths);
$form['2'] = array(
'#title' => t('Auto Classified path set'),
'#description' => t('Helper: merge all paths belonging to the Classified Ads application into the above list.'),
'#type' => 'checkbox',
'#default_value' => $common_paths == $classified_paths,
);
return $form;
}