17 require_once SQ_CORE_PACKAGE_PATH.
'/designs/design_area/design_area.inc';
18 require_once SQ_LIB_PATH.
'/html_form/html_form.inc';
43 parent::__construct($assetid);
57 $assetid = $this->
attr(
'search_page_assetid');
58 return !($assetid <= 0);
74 function printVar($var, $args, $value_prefix=
'', $value_suffix=
'')
76 $assetid = $this->
attr(
'search_page_assetid');
77 if (empty($assetid))
return;
78 $am =& $GLOBALS[
'SQ_SYSTEM']->am;
79 $asset = $am->getAsset($assetid);
85 <?php $asset = $GLOBALS["SQ_SYSTEM"]->am->getAsset('.$asset->id.
'); ?>
86 <form method="get" action="<?php echo $asset->getURL(); ?>">
95 if ($this->
attr(
'submit_button')) {
96 $class = isset($args[
'class']) ?
' class="'.$args[
'class'].
'"' :
'';
98 $button_value = $this->
attr(
'submit_button_text');
99 echo
'<input type="submit" value="'.$button_value.
'"'.$class.
' />';
102 $submit_image_assetid = $this->
attr(
'submit_image_assetid');
103 if ($submit_image_assetid > 0) {
104 $submit_image_asset = $am->getAsset($submit_image_assetid);
105 echo
'<'.
'?php $submit_image_asset = $GLOBALS[\'SQ_SYSTEM\']->am->getAsset('.$submit_image_asset->id.
', "'.$submit_image_asset->type().
'"); ?'.
'>';
106 echo
'<input alt="'.$this->attr(
'submit_button_text').
'" type="image"';
107 if (isset($args[
'class'])) {
108 echo
' class="'.$args[
'class'].
'"';
110 echo
' src="<'.
'?php echo $submit_image_asset->getURL(); ?'.
'>" />';
117 case 'category_list':
118 $category_set = $this->
attr(
'category_set');
119 $default = $this->
attr(
'category_default');
120 $show_empty = $this->
attr(
'category_show_empty');
121 if (!empty($category_set)) {
124 $asset = $GLOBALS["SQ_SYSTEM"]->am->getAsset('.$asset->id.
');
125 $categories = $asset->attr("categories");
126 echo $asset->getCategoryChooserReplacement("'.$category_set.
'", $categories["'.$category_set.
'"], "'.$default.
'", '.var_export($show_empty, TRUE).
');
133 $class = isset($args[
'class']) ?
' class="'.$args[
'class'].
'"' :
'';
134 $id = isset($args[
'id']) ?
' id="'.$args[
'id'].
'"' :
'';
136 $title_val = $this->
attr(
'querybox_title');
137 $title = !empty($title_val) ?
' title="'.$this->attr(
'querybox_title').
'"' :
'';
139 $label_val = $this->
attr(
'querybox_label');
141 if (!empty($label_val)) {
142 if (!empty($args[
'id'])) {
143 $label =
'<label for="'.$args[
'id'].
'">'.$this->
attr(
'querybox_label').
'</label>';
145 $label =
'<label for="'.htmlspecialchars($this->
attr(
'field_name')).
'">'.$this->
attr(
'querybox_label').
'</label>';
149 <input type="hidden" name="mode" value="results" />
151 $asset = $GLOBALS["SQ_SYSTEM"]->am->getAsset('.$asset->id.
');
153 $field_name = "'.$this->
attr(
'field_name').
'";
154 $box_width = '.$this->
attr(
'querybox_width').
';
155 if (!empty($field_name)) {
156 $form_field_name = "queries_".$field_name."_query";
157 $field_value = $asset->getQueryFieldValue($field_name);
159 if (empty($field_value)) {
160 $field_value = "'.$this->
attr(
'default_text').
'";
161 $hide_default = true;
163 $hide_default = false;
166 require_once SQ_LIB_PATH."/html_form/html_form.inc";
167 '.(!empty($label) ?
'echo \''.$label.
'\';
' : '').'
168 text_box($form_field_name, $field_value, $box_width,
"", $hide_default, \
''.$class.$id.$title.
'\');
175 if (substr($var, -6) == '_query
') {
178 $asset = $GLOBALS[
"SQ_SYSTEM"]->am->getAsset(
'.$asset->id.');
179 echo $asset->getFieldReplacement(
"'.substr($var, 0, -6).'");
181 } else if (substr($var, -17) == '_category_chooser
') {
184 $asset = $GLOBALS[
"SQ_SYSTEM"]->am->getAsset(
'.$asset->id.');
185 $categories = $asset->attr(
"categories");
186 echo $asset->getCategoryChooserReplacement(
"'.substr($var, 0, -17).'", $categories[
"'.substr($var, 0, -17).'"]);