17 require_once SQ_INCLUDE_PATH.
'/asset_edit/asset_edit_fns.inc';
42 parent::__construct($assetid);
43 unset($this->static_screens[
'settings']);
44 unset($this->static_screens[
'preview']);
45 unset($this->static_screens[
'lookupValues']);
46 unset($this->static_screens[
'metadata']);
47 unset($this->static_screens[
'metadataSchemas']);
48 unset($this->static_screens[
'workflow']);
49 unset($this->static_screens[
'tagging']);
50 unset($this->static_screens[
'dependants']);
51 unset($this->static_screens[
'linking']);
52 unset($this->static_screens[
'roles']);
53 unset($this->static_screens[
'permissions']);
54 unset($this->static_screens[
'layouts']);
70 return $owner->attr(
'indexing');
87 $wa = $asset->writeAccess(
'attributes');
88 $indexing = $asset->attr(
'indexing');
89 $options = Array(
'0'=>translate(
'disabled'),
'1'=>translate(
'enabled'));
91 combo_box($prefix.
'_indexing', $options, FALSE, (($indexing) ?
'1' :
'0'));
93 echo (($indexing) ? translate(
'enabled') : translate(
'disabled'));
114 $wa = $asset->writeAccess(
'attributes');
115 $choice = array_get_index($_POST, $prefix.
'_indexing', FALSE);
117 if ($choice ==
'1') {
118 $asset->setAttrValue(
'indexing', TRUE);
120 if ($asset->checkInstalled() === FALSE) {
121 log_dump(
'Funnelback is enabled, but the binaries are not installed');
124 $asset->setAttrValue(
'indexing', FALSE);
127 $status = $asset->saveAttributes();
147 $wa = $asset->writeAccess(
'attributes');
149 asset_finder($prefix.
'_rebuild_root_node', 0);
152 $o->openField(translate(
'system_wide'));
154 check_box($prefix.
'_rebuild_all_system', 1);
155 echo translate(
'funnelback_rebuild_whole_system');
176 $wa = $asset->writeAccess(
'attributes');
178 $node_info = array_get_index($_POST, $prefix.
'_rebuild_root_node', Array());
179 $all_system = array_get_index($_POST, $prefix.
'_rebuild_all_system', 0);
180 $root_node = array_get_index($node_info,
'assetid', 0);
182 if (!empty($all_system)) {
183 $hh = $GLOBALS[
'SQ_SYSTEM']->getHipoHerder();
184 $running_vars = Array(
'root_assetid' => Array());
185 $hh->queueHipo(
'hipo_job_funnelback_rebuild_cache', $running_vars,
'', SQ_PACKAGES_PATH.
'/funnelback/hipo_jobs');
186 }
else if (!empty($root_node) && $GLOBALS[
'SQ_SYSTEM']->am->assetExists($root_node)) {
188 $hh = $GLOBALS[
'SQ_SYSTEM']->getHipoHerder();
189 $running_vars = Array(
'root_assetid' => Array($root_node));
190 $hh->queueHipo(
'hipo_job_funnelback_rebuild_cache', $running_vars,
'', SQ_PACKAGES_PATH.
'/funnelback/hipo_jobs');
216 $wa = $asset->writeAccess(
'attributes');
219 $collections = $asset->getCollections();
221 foreach ($collections as $collection_id => $collection_data) {
222 $name = array_get_index($collection_data,
'name',
'');
223 $valid = array_get_index($collection_data,
'valid', TRUE);
224 if (empty($name))
continue;
225 check_box($prefix.
'_reindex_collection[]', $collection_id);
230 $o->openField(translate(
'system_wide'));
232 check_box($prefix.
'_reindex_all_system', 1);
233 echo translate(
'funnelback_index_whole_system');
235 echo translate(
'funnelback_indexing_not_enabled');
256 $wa = $asset->writeAccess(
'attributes');
258 $collections = array_get_index($_POST, $prefix.
'_reindex_collection', Array());
259 $all_system = array_get_index($_POST, $prefix.
'_reindex_all_system', 0);
262 if (!empty($all_system)) {
264 $collections = Array();
266 }
else if (!empty($collections)) {
272 $hh = $GLOBALS[
'SQ_SYSTEM']->getHipoHerder();
273 $running_vars = Array(
'collections' => $collections);
274 $hh->queueHipo(
'hipo_job_funnelback_reindex', $running_vars,
'', SQ_PACKAGES_PATH.
'/funnelback/hipo_jobs');
299 $wa = $asset->writeAccess(
'attributes');
303 $js =
'onChange="javascript:funnelbackDisableURL(this);"';
304 $o->openField(translate(
'funnelback_collection_id'),
'', translate(
'funnelback_collection_id_note'));
305 text_box($prefix.
'_new_collection');
307 $o->openField(translate(
'funnelback_collection_name'),
'', translate(
'funnelback_collection_name_note'));
308 text_box($prefix.
'_new_collection_name');
310 $o->openField(translate(
'funnelback_collection_type'));
311 combo_box($prefix.
'_new_collection_type', $asset->_getCollectionTypes(), FALSE,
'web', 0, $js);
333 $wa = $asset->writeAccess(
'attributes');
336 $new_collection = array_get_index($_POST, $prefix.
'_new_collection',
'');
337 $new_collection_name = array_get_index($_POST, $prefix.
'_new_collection_name',
'');
338 $new_collection_type = array_get_index($_POST, $prefix.
'_new_collection_type',
'web');
339 $collections = $asset->getCollections();
340 $new_collection = str_replace(
' ',
'_', $new_collection);
341 if (!empty($new_collection) && !isset($collections[$new_collection])) {
342 $collections[$new_collection] = Array(
343 'name' => $new_collection_name,
344 'type' => $new_collection_type,
347 $asset->setAttrValue(
'collections', $collections);
348 $saved = $asset->saveAttributes();
349 $coll_path = $asset->getCollectionDataPath($new_collection);
350 $config_files = $asset->getCollectionConfigFiles($new_collection);
351 foreach ($config_files as $type => $config) {
352 $asset->createCollectionConfig($config, $type);
374 $wa = $asset->writeAccess(
'attributes');
375 $collections = $asset->getCollections();
376 $collection_id = array_get_index($_POST, $prefix.
'_edit_collection',
'');
377 hidden_field($prefix.
'_edit_collection', $collection_id);
379 <table
class=
"sq-backend-table" style=
"width:100%">
381 <?php
if ($wa) { ?><td
class=
"sq-backend-table-header"><?php echo translate(
'edit'); ?></td><?php } ?>
382 <td
class=
"sq-backend-table-header" width=
"20%"><?php echo translate(
'funnelback_collection_id'); ?></td>
383 <td
class=
"sq-backend-table-header" width=
"50%"><?php echo translate(
'funnelback_collection_name'); ?></td>
384 <td
class=
"sq-backend-table-header" width=
"20%"><?php echo translate(
'funnelback_collection_type'); ?></td>
385 <td
class=
"sq-backend-table-header" width=
"20%"><?php echo translate(
'valid_question'); ?></td>
386 <?php
if ($wa) { ?><td
class=
"sq-backend-table-header"><?php echo translate(
'delete'); ?>?</td><?php } ?>
389 if (!empty($collections)) {
390 foreach ($collections as $coll_id => $collection_info) {
391 if ($collection_id == $coll_id) {
392 $class =
'sq-table-row alt';
394 $class =
'sq-table-row';
396 echo
'<tr class="'.$class.
'"><td>';
398 $img =
'<a href="#" onclick="document.getElementById(\''.$prefix.
'_edit_collection\').value = \''.$coll_id.
'\'; document.main_form.submit();
return false;
"><img src="'.sq_web_path('lib
').'/web/images/icons/edit_mode.png
" width="15
" height="15
" border="0
" /></a>';
399 echo '<p>'.$img.'</p>';
404 echo array_get_index($collection_info, 'name', '');
406 $current_type = array_get_index($collection_info, 'type', 'web');
407 $types = $asset->_getCollectionTypes();
408 echo array_get_index($types, $current_type, $types['web']);
410 if (array_get_index($collection_info, 'valid', FALSE) && $this->_checkCollection($collections, $coll_id)) {
415 echo '<img src="'.sq_web_path('lib
').'/web/images/
'.$icon.'.gif
" border="0
" />';
418 check_box($prefix.'_delete[]', $coll_id);
423 $cols = ($wa) ? '6' : '4';
424 echo '<tr><td align="center
" colspan="'.$cols.'">'.translate('funnelback_no_collection').'</td></tr>';
432 }//end paintCollections()
445 function processCollections(&$asset, &$o, $prefix)
448 $wa = $asset->writeAccess('attributes');
449 $collections = $asset->getCollections();
450 $delete_collection = array_get_index($_POST, $prefix.'_delete', Array());
452 if (!empty($delete_collection)) {
453 foreach($delete_collection as $del_collection) {
454 if (isset($collections[$del_collection])) {
455 // Get the collection data path
456 $coll_path = $asset->getCollectionDataPath($del_collection);
457 if (is_dir($coll_path)) {
458 require_once SQ_FUDGE_PATH.'/general/file_system.inc';
459 delete_directory($coll_path);
462 // 'Delete' the collection
463 unset($collections[$del_collection]);
466 $asset->setAttrValue('collections', $collections);
467 $status = $asset->saveAttributes();
473 }//end processCollections()
486 function paintSelectedCollection(&$asset, &$o, $prefix)
488 $wa = $asset->writeAccess('attributes');
489 $collections = $asset->getCollections();
490 $collection_id = array_get_index($_POST, $prefix.'_edit_collection', NULL);
493 if (!empty($collection_id) && isset($collections[$collection_id])) {
494 $current_type = array_get_index($collections[$collection_id], 'type', 'web');
495 $current_name = array_get_index($collections[$collection_id], 'name', '');
496 $current_assetid = array_get_index($collections[$collection_id], 'asset', Array());
497 $current_url = array_get_index($collections[$collection_id], 'url', Array());
498 $o->openField(translate('funnelback_collection_name'));
499 hidden_field($prefix.'_edit_collection_id', $collection_id);
500 text_box($prefix.'_edit_collection_name', $current_name);
502 switch ($current_type) {
504 $o->openField(translate('funnelback_collections'));
505 $all_collections = $asset->getCollections();
506 $selected_collections = array_get_index($collections[$collection_id], 'collections', Array());
507 unset($all_collections[$collection_id]);
509 <table class="sq-backend-table
" style="width:70%
">
511 <td class="sq-backend-table-header
" width="80%
">
512 <?php echo translate('funnelback_collection_name'); ?>
514 <td class="sq-backend-table-header
"><?php echo translate('please_select'); ?>?</td>
517 foreach ($all_collections as $each_collection_id => $each_collection) {
518 $selected = (in_array($each_collection_id, $selected_collections)) ? TRUE : FALSE;
519 $name = array_get_index($each_collection, 'name', '');
520 if (empty($name)) continue;
524 check_box($prefix.'_edit_collection_meta_collections[]', $each_collection_id, $selected);
534 $o->openField(translate('funnelback_collection_source'));
535 asset_finder($prefix.'_edit_collection_source', $current_assetid);
537 $o->openField(translate('funnelback_collection_url'));
539 if (!empty($current_assetid)) {
540 $current_asset = $GLOBALS['SQ_SYSTEM']->am->getAsset($current_assetid, '', TRUE);
541 if (!is_null($current_asset)) {
542 $possible_urls = $current_asset->getURLs();
543 foreach ($possible_urls as $possible_url) {
544 $http = array_get_index($possible_url, 'http', FALSE);
545 $https = array_get_index($possible_url, 'https', FALSE);
546 $purl = array_get_index($possible_url, 'url', '');
548 if ($http && !empty($purl)) {
549 $urls[] = 'http://'.$purl;
551 if ($https && !empty($purl)) {
552 $urls[] = 'https://'.$purl;
559 echo translate('funnelback_collection_no_url');
561 foreach ($urls as $url) {
562 check_box($prefix.'_edit_collection_url[]', $url, ((in_array($url, $current_url)) ? TRUE : FALSE));
563 echo ' '.htmlspecialchars($url).'<br />';
573 }//end paintSelectedCollection()
586 function processSelectedCollection(&$asset, &$o, $prefix)
590 $wa = $asset->writeAccess('attributes');
591 $collections = $asset->getCollections();
592 $collection_id = array_get_index($_POST, $prefix.'_edit_collection_id', NULL);
595 if (!empty($collection_id) && isset($collections[$collection_id])) {
596 $name = array_get_index($_POST, $prefix.'_edit_collection_name', '');
597 $source = array_get_index($_POST, $prefix.'_edit_collection_source', '');
598 $url = array_get_index($_POST, $prefix.'_edit_collection_url', Array());
599 $current_type = array_get_index($collections[$collection_id], 'type', 'web');
600 if ($current_type == 'meta') {
601 $meta_collections = array_get_index($_POST, $prefix.'_edit_collection_meta_collections', Array());
602 $collections[$collection_id]['valid'] = FALSE;
603 $collections[$collection_id]['collections'] = $meta_collections;
604 // Create the meta collection
605 $index_paths = Array();
606 foreach ($meta_collections as $meta_collection) {
607 $meta_collection_data_path = $asset->getCollectionDataPath($meta_collection, 'idx');
608 if (!empty($meta_collection_data_path) && is_dir($meta_collection_data_path)) {
609 $index_paths[] = $meta_collection_data_path.'/'.$meta_collection;
612 $data_path = $asset->getCollectionDataPath($collection_id, 'idx');
613 // Create the meta collection
614 // No indexing is needed as the other collections it uses, should handle indexing themselves
615 $create_status = file_put_contents($data_path.'/'.$collection_id.'.sdinfo', implode("\n
", $index_paths));
616 if ($create_status !== FALSE && !empty($index_paths)) {
617 $collections[$collection_id]['valid'] = TRUE;
622 $collections[$collection_id]['name'] = $name;
625 if (!empty($source)) {
626 $source_assetid = array_get_index($source, 'assetid', 0);
627 if (!empty($source_assetid)) {
628 $source_asset = $GLOBALS['SQ_SYSTEM']->am->getAsset($source_assetid);
629 if (!empty($source_asset)) {
630 $asset_url = $source_asset->getURL();
631 $unrestricted_asset = strpos($asset_url, '/__data/') !== FALSE ||
632 (SQ_CONF_STATIC_ROOT_URL && strpos($asset_url, SQ_CONF_STATIC_ROOT_URL.'/') !== FALSE);
633 $GLOBALS['SQ_SYSTEM']->am->forgetAsset($source_asset);
635 if ($unrestricted_asset) {
636 trigger_localised_error('FNB0015', E_USER_WARNING);
639 $collections[$collection_id]['asset'] = $source_assetid;
644 if ($current_type == 'web') {
645 $collections[$collection_id]['url'] = $url;
646 if (empty($url) || empty($collections[$collection_id]['asset'])) {
647 $collections[$collection_id]['valid'] = FALSE;
653 // First check, and make valid if an assetid/url are set correctly
654 $collections = $this->_checkCollection($collections);
655 $asset->setAttrValue('collections', $collections);
656 $status = $asset->saveAttributes();
663 }//end processSelectedCollection()
666 // --- THESAURUS SCREEN FUNCTIONS --- //
679 function paintThesaurusChooser(&$asset, &$o, $prefix)
681 $wa = $asset->writeAccess('attributes');
682 $collections = $asset->getCollections();
683 $collection_selecter = Array();
684 $current_choice = array_get_index($_POST, $prefix.'_choose_thesaurus', '');
685 foreach ($collections as $id => $collection) {
686 $collection_selecter[$id] = array_get_index($collection, 'name', '');
688 ksort($collection_selecter);
691 if (!empty($collection_selecter)) {
692 echo combo_box($prefix.'_choose_thesaurus', $collection_selecter, FALSE, $current_choice);
694 echo translate('funnelback_no_collection_to_proceed');
700 }//end paintThesaurusChooser()
713 function processThesaurusChooser(&$asset, &$o, $prefix)
715 // I don't do anything ;)
719 }//end processThesaurusChooser()
732 function paintThesaurus(&$asset, &$o, $prefix)
734 $wa = $asset->writeAccess('attributes');
735 $collections = $asset->getCollections();
736 $current_choice = array_get_index($_POST, $prefix.'_choose_thesaurus', '');
737 hidden_field($prefix.'_chosen_thesaurus', $current_choice);
738 $thesaurus_types = Array('term'=>translate('fb_term_term'), 'whole'=>translate('fb_whole'), 'regex'=>translate('fb_regex'));
739 if ($wa && !empty($current_choice) && isset($collections[$current_choice])) {
740 $thesaurus_config = $asset->getCollectionDataPath($current_choice, 'conf').'/synonyms.cfg';
741 $config = $asset->readConfiguration($thesaurus_config);
743 <table class="sq-backend-table
">
745 <td class="sq-backend-table-header
"><?php echo translate('fb_query'); ?></td>
746 <td class="sq-backend-table-header
"><?php echo translate('fb_term'); ?></td>
747 <td class="sq-backend-table-header
"><?php echo translate('fb_replacement'); ?></td>
748 <td class="sq-backend-table-header
"><?php echo translate('delete'); ?></td>
753 foreach ($config as $line) {
755 echo combo_box($prefix.'_thesaurus_query['.$count.']', $thesaurus_types, FALSE, $line['query']);
757 echo text_box($prefix.'_thesaurus_term['.$count.']', $line['term'], 30);
759 echo text_box($prefix.'_thesaurus_expansion['.$count.']', $line['expansion'], 30);
761 echo check_box($prefix.'_thesaurus_delete['.$count.']', '1');
767 for ($i=$count; $i<=($count+1); $i++) {
769 echo combo_box($prefix.'_thesaurus_query['.$i.']', $thesaurus_types);
771 echo text_box($prefix.'_thesaurus_term['.$i.']', '', 30);
773 echo text_box($prefix.'_thesaurus_expansion['.$i.']', '', 30);
775 echo check_box($prefix.'_thesaurus_delete['.$i.']', '1');
781 } else if (!empty($current_choice) && !isset($collections[$current_choice])) {
782 echo translate('funnelback_missing_collection', $current_choice);
787 }//end paintThesaurus()
800 function processThesaurus(&$asset, &$o, $prefix)
803 $wa = $asset->writeAccess('attributes');
804 if (!$wa) return $status;
806 $collection = array_get_index($_POST, $prefix.'_chosen_thesaurus', '');
807 if (empty($collection)) return $status;
809 // Grab all the terms, expansions etc.
810 $query = array_get_index($_POST, $prefix.'_thesaurus_query', Array());
811 $term = array_get_index($_POST, $prefix.'_thesaurus_term', Array());
812 $expansion = array_get_index($_POST, $prefix.'_thesaurus_expansion', Array());
813 $delete = array_get_index($_POST, $prefix.'_thesaurus_delete', Array());
815 if (empty($query) || (count($query) != count($term) && count($query) != count($expansion))) {
820 foreach ($query as $id => $each_query) {
821 if (!isset($delete[$id]) || $delete[$id] != '1') {
823 if ($each_query == 'term') {
825 } else if ($each_query == 'regex') {
828 $data[] = Array('query'=>$query_type, 'term'=>$term[$id], 'expansion'=>$expansion[$id]);
832 $config = $asset->getCollectionDataPath($collection, 'conf').'/synonyms.cfg';
833 $asset->writeConfiguration($config, $data);
837 }//end processThesaurus()
840 // --- FEATURE PAGES SCREEN FUNCTIONS --- //
853 function paintFeaturePageChooser(&$asset, &$o, $prefix)
855 $wa = $asset->writeAccess('attributes');
856 $collections = $asset->getCollections();
857 $collection_selecter = Array();
858 $current_choice = array_get_index($_POST, $prefix.'_edit_feature_page', '');
859 foreach ($collections as $id => $collection) {
860 $collection_selecter[$id] = array_get_index($collection, 'name', '');
862 ksort($collection_selecter);
865 if (!empty($collection_selecter)) {
866 echo combo_box($prefix.'_edit_feature_page', $collection_selecter, FALSE, $current_choice);
868 echo translate('funnelback_no_collection_to_proceed');
874 }//end paintFeaturePageChooser()
887 function processFeaturePageChooser(&$asset, &$o, $prefix)
889 $wa = $asset->writeAccess('attributes');
890 $collection_id = array_get_index($_POST, $prefix.'_edit_feature_page', '');
892 $current_feature_pages = $asset->attr('feature_pages');
893 if (!empty($collection_id) && !isset($current_feature_pages[$collection_id])) {
894 $current_feature_pages[$collection_id] = Array(
896 'query' => 'substring',
903 $asset->setAttrValue('feature_pages', $current_feature_pages);
904 return $asset->saveAttributes();
910 }//end processFeaturePageChooser()
923 function paintFeaturePage(&$asset, &$o, $prefix)
925 $wa = $asset->writeAccess('attributes');
926 $collections = $asset->getCollections();
927 $config = $asset->attr('feature_pages');
928 $collection_id = array_get_index($_POST, $prefix.'_edit_feature_page', '');
929 $line_id = array_get_index($_POST, $prefix.'_edit_feature_page_line', '');
930 hidden_field($prefix.'_edit_feature_page_collection_id', $collection_id);
931 hidden_field($prefix.'_edit_feature_page_line', $line_id);
932 if (!empty($collection_id)) {
933 $collection_name = array_get_index(array_get_index($collections, $collection_id, Array()), 'name', '');
934 echo translate('funnelback_editing_collection', $collection_name);
936 <table class="sq-backend-table
">
938 <?php if ($wa) { ?><td class="sq-backend-table-header
"><?php echo translate('edit'); ?></td><?php } ?>
939 <td class="sq-backend-table-header
"><?php echo translate('fb_trigger'); ?></td>
940 <td class="sq-backend-table-header
"><?php echo translate('valid_question'); ?></td>
941 <td class="sq-backend-table-header
"><?php echo translate('url'); ?></td>
942 <?php if ($wa) { ?><td class="sq-backend-table-header
"><?php echo translate('delete'); ?>?</td><?php } ?>
945 if (isset($config[$collection_id])) {
946 // Current feature pages
947 foreach ($config[$collection_id] as $index => $feature_page) {
948 $feature_trigger = array_get_index($feature_page, 'trigger', '');
949 $feature_url = array_get_index($feature_page, 'url', '');
950 if ($index == $line_id) {
951 $class = 'sq-table-row alt';
953 $class = 'sq-table-row';
955 echo '<tr class="'.$class.'"><td>';
957 $img = '<a href="#
" onclick="document.getElementById(\
''.$prefix.
'_edit_feature_page_line\').value = \''.$index.
'\'; document.getElementById(\
''.$prefix.
'_edit_selected_feature_page_changed\').value = \'0\'; document.main_form.submit(); return false;"><img src="'.sq_web_path(
'lib').
'/web/images/icons/edit_mode.png" width="15" height="15" border="0" /></a>';
958 echo
'<p>'.$img.
'</p>';
961 echo $feature_trigger;
963 if (array_get_index($feature_page,
'valid', FALSE)) {
968 echo
'<img src="'.sq_web_path(
'lib').
'/web/images/'.$icon.
'.gif" border="0" />';
969 echo
'</td><td width="50%">';
970 echo htmlspecialchars($feature_url, ENT_COMPAT, SQ_CONF_DEFAULT_CHARACTER_SET);
972 echo check_box($prefix.
'_feature_delete['.$index.
']',
'1');
981 echo int_text_box($prefix.
'_add_new', 0, FALSE, 5, 0, 10);
982 echo
' '.translate(
'funnelback_add_new_feature_page');
985 echo translate(
'funnelback_no_collection_selected');
1003 function processFeaturePage(&$asset, &$o, $prefix)
1006 $wa = $asset->writeAccess(
'attributes');
1008 $collection_id = array_get_index($_POST, $prefix.
'_edit_feature_page_collection_id',
'');
1009 $feature_pages = $asset->attr(
'feature_pages');
1010 if (!empty($collection_id) && isset($feature_pages[$collection_id])) {
1011 $feature_delete = array_get_index($_POST, $prefix.
'_feature_delete', Array());
1012 $new_feature = Array();
1014 foreach ($feature_pages[$collection_id] as $index => $current_settings) {
1015 if (isset($feature_delete[$index]) && $feature_delete[$index] ==
'1') {
1016 unset($feature_pages[$collection_id][$index]);
1019 $new_feature[] = $current_settings;
1023 $add_new = array_get_index($_POST, $prefix.
'_add_new', 0);
1024 if (!empty($add_new)) {
1026 for ($i=0; $i<$add_new; $i++) {
1027 $new_feature[] = Array(
'query'=>
'substring',
'trigger'=>
'',
'url'=>
'',
'assetid'=>0,
'valid'=>FALSE);
1032 $feature_pages[$collection_id] = $new_feature;
1033 $asset->setAttrValue(
'feature_pages', $feature_pages);
1034 $status = $asset->saveAttributes();
1035 $this->_writeFeaturePagesConfiguration($asset, $collection_id, $new_feature);
1055 function paintSelectedFeaturePage(&$asset, &$o, $prefix)
1058 $wa = $asset->writeAccess(
'attributes');
1059 $feature_queries = Array(
1060 'term' => translate(
'fb_term_term'),
1061 'exact' => translate(
'fb_exact'),
1062 'regex' => translate(
'fb_regex'),
1063 'substring' => translate(
'fb_substring'),
1066 $config = $asset->attr(
'feature_pages');
1067 $collection_id = array_get_index($_POST, $prefix.
'_edit_feature_page_collection_id',
'');
1068 $line_id = array_get_index($_POST, $prefix.
'_edit_feature_page_line',
'');
1069 if ($collection_id !=
'' && $line_id !=
'') {
1070 if (isset($config[$collection_id][$line_id])) {
1072 $line_data = $config[$collection_id][$line_id];
1074 $o->openField(translate(
'fb_query'));
1075 $query = array_get_index($line_data,
'query',
'substring');
1076 echo combo_box($prefix.
'_edit_selected_feature_page_query', $feature_queries, FALSE, $query);
1078 $o->openField(translate(
'fb_trigger'));
1079 $trigger = array_get_index($line_data,
'trigger',
'');
1080 echo text_box($prefix.
'_edit_selected_feature_page_trigger', $trigger, 25);
1082 $o->openField(translate(
'fb_title'));
1083 $title = array_get_index($line_data,
'title',
'');
1084 echo text_box($prefix.
'_edit_selected_feature_page_title', $title, 25);
1086 $o->openField(translate(
'fb_desc'));
1087 $desc = array_get_index($line_data,
'desc',
'');
1088 echo text_area($prefix.
'_edit_selected_feature_page_desc', $desc, 22, 3);
1090 $o->openField(translate(
'asset'));
1091 $assetid = array_get_index($line_data,
'assetid', 0);
1092 echo asset_finder($prefix.
'_edit_selected_feature_page_assetid', $assetid, Array(
'page'=>
'D',
'site'=>
'D'));
1094 $o->openField(translate(
'url'));
1095 $url = array_get_index($line_data,
'url',
'');
1096 if ($GLOBALS[
'SQ_SYSTEM']->am->assetExists($assetid)) {
1097 $asset_urls = Array();
1098 $raw_urls = $GLOBALS[
'SQ_SYSTEM']->am->getURLs($assetid);
1099 foreach ($raw_urls as $raw_url) {
1100 $base_url = array_get_index($raw_url,
'url',
'');
1101 $http = array_get_index($raw_url,
'http', 0);
1102 $https = array_get_index($raw_url,
'https', 0);
1104 $new_url =
'http://'.$base_url;
1105 $asset_urls[$new_url] = $new_url;
1108 $new_url =
'https://'.$base_url;
1109 $asset_urls[$new_url] = $new_url;
1112 echo combo_box($prefix.
'_edit_selected_feature_page_url', $asset_urls, FALSE, $url);
1117 hidden_field($prefix.
'_edit_selected_feature_page_changed', $changed);
1134 function processSelectedFeaturePage(&$asset, &$o, $prefix)
1137 $wa = $asset->writeAccess(
'attributes');
1139 $config = $asset->attr(
'feature_pages');
1140 $collection_id = array_get_index($_POST, $prefix.
'_edit_feature_page',
'');
1141 $line_id = array_get_index($_POST, $prefix.
'_edit_feature_page_line',
'');
1142 if ($collection_id !=
'' && $line_id !=
'') {
1143 if (isset($config[$collection_id][$line_id])) {
1144 $changed = array_get_index($_POST, $prefix.
'_edit_selected_feature_page_changed',
'0');
1145 $query = array_get_index($_POST, $prefix.
'_edit_selected_feature_page_query',
'substring');
1146 $trigger = array_get_index($_POST, $prefix.
'_edit_selected_feature_page_trigger',
'');
1147 $title = array_get_index($_POST, $prefix.
'_edit_selected_feature_page_title',
'');
1148 $desc = array_get_index($_POST, $prefix.
'_edit_selected_feature_page_desc',
'');
1149 $asset_info = array_get_index($_POST, $prefix.
'_edit_selected_feature_page_assetid', Array());
1150 $assetid = array_get_index($asset_info,
'assetid', 0);
1151 if (!empty($assetid)) {
1152 $asset_info = $GLOBALS[
'SQ_SYSTEM']->am->getAssetInfo($assetid, Array(), TRUE,
'type_code');
1153 if (isset($asset_info[$assetid])) {
1154 $asset_type = $asset_info[$assetid];
1155 if (!($GLOBALS[
'SQ_SYSTEM']->am->isTypeDecendant($asset_type,
'page') || $GLOBALS[
'SQ_SYSTEM']->am->isTypeDecendant($asset_type,
'site'))) {
1162 $url = array_get_index($_POST, $prefix.
'_edit_selected_feature_page_url',
'');
1163 $edit_feature = Array(
'query'=>$query,
'trigger'=>$trigger,
'assetid'=>$assetid,
'url'=>$url,
'valid'=>FALSE);
1164 if (!empty($title)) $edit_feature[
'title'] = $title;
1165 if (!empty($desc)) $edit_feature[
'desc'] = $desc;
1168 if ($GLOBALS[
'SQ_SYSTEM']->am->assetExists($assetid)) {
1169 $asset_urls = Array();
1170 $raw_urls = $GLOBALS[
'SQ_SYSTEM']->am->getURLs($assetid);
1171 foreach ($raw_urls as $raw_url) {
1172 $base_url = array_get_index($raw_url,
'url',
'');
1173 $http = array_get_index($raw_url,
'http', 0);
1174 $https = array_get_index($raw_url,
'https', 0);
1176 $new_url =
'http://'.$base_url;
1177 $asset_urls[$new_url] = $new_url;
1180 $new_url =
'https://'.$base_url;
1181 $asset_urls[$new_url] = $new_url;
1184 if (in_array($url, $asset_urls)) {
1185 $edit_feature[
'valid'] = TRUE;
1187 $edit_feature[
'url'] =
'';
1191 if ($changed ==
'1') {
1192 $config[$collection_id][$line_id] = $edit_feature;
1193 $asset->setAttrValue(
'feature_pages', $config);
1194 $status = $asset->saveAttributes();
1195 $this->_writeFeaturePagesConfiguration($asset, $collection_id, $config[$collection_id]);
1219 function paintFlusterChooser(&$asset, &$o, $prefix)
1221 $wa = $asset->writeAccess(
'attributes');
1222 $collections = $asset->getCollections();
1223 $collection_selecter = Array();
1224 $current_choice = array_get_index($_POST, $prefix.
'_edit_fluster',
'');
1225 foreach ($collections as $id => $collection) {
1226 $collection_selecter[$id] = array_get_index($collection,
'name',
'');
1228 ksort($collection_selecter);
1231 if (!empty($collection_selecter)) {
1232 echo combo_box($prefix.
'_edit_fluster', $collection_selecter, FALSE, $current_choice);
1234 echo translate(
'funnelback_no_collection_to_proceed');
1253 function processFlusterChooser(&$asset, &$o, $prefix)
1272 function paintFluster(&$asset, &$o, $prefix)
1274 $wa = $asset->writeAccess(
'attributes');
1275 $collections = $asset->getCollections();
1276 $collection_id = array_get_index($_POST, $prefix.
'_edit_fluster',
'');
1277 if ($wa && !empty($collection_id) && isset($collections[$collection_id])) {
1278 $coll_conf_path = $asset->getCollectionDataPath($collection_id,
'conf');
1279 $fluster_config = $coll_conf_path.
'/contextual_navigation.cfg';
1280 $asset->createCollectionConfig($fluster_config,
'fluster');
1281 $config = $asset->readConfiguration($fluster_config,
'fluster');
1282 $multi_opts = Array(
'cannot_end_with',
'kill_list');
1283 $bool_opts = Array(
'categorise_clusters',
'enable_fluster');
1284 hidden_field($prefix.
'_fluster_collection_id', $collection_id);
1285 foreach ($config as $switch => $parameter) {
1286 $name = str_replace(
'.',
'_', $switch);
1288 $o->openField(ucwords(str_replace(
'_',
' ', $name)));
1291 if ($switch ==
'enable_fluster')
continue;
1293 if (in_array($switch, $multi_opts)) {
1295 hidden_field($prefix.
'_fluster_multi_opts[]', $switch);
1296 require_once SQ_ATTRIBUTES_PATH.
'/option_list/option_list.inc';
1298 $opts->_edit_params[
'allow_reorder'] = FALSE;
1299 $opts->delimiter =
',';
1300 $opts->value = $parameter;
1301 $opts->paint($prefix.
'_fluster_opt_'.$name);
1302 }
else if (in_array($switch, $bool_opts)) {
1304 $options = Array(
'true' => translate(
'true'),
'false' => translate(
'false'));
1305 if (!array_key_exists($parameter, $options)) $parameter =
'false';
1306 hidden_field($prefix.
'_fluster_opts[]', $switch);
1307 combo_box($prefix.
'_fluster_opt_'.$name, $options, FALSE, $parameter);
1309 hidden_field($prefix.
'_fluster_opts[]', $switch);
1310 text_box($prefix.
'_fluster_opt_'.$name, $parameter);
1314 echo translate(
'funnelback_no_collection_selected');
1332 function processFluster(&$asset, &$o, $prefix)
1335 $wa = $asset->writeAccess(
'attributes');
1337 $collection_id = array_get_index($_POST, $prefix.
'_fluster_collection_id',
'');
1338 if (!empty($collection_id)) {
1339 $coll_conf_path = $asset->getCollectionDataPath($collection_id,
'conf');
1340 $fluster_config = $coll_conf_path.
'/contextual_navigation.cfg';
1342 $options = array_get_index($_POST, $prefix.
'_fluster_opts', Array());
1343 $multi_options = array_get_index($_POST, $prefix.
'_fluster_multi_opts', Array());
1344 foreach ($options as $opt_name) {
1345 $name = str_replace(
'.',
'_', $opt_name);
1346 $data[$opt_name] = array_get_index($_POST, $prefix.
'_fluster_opt_'.$name,
'');
1348 foreach ($multi_options as $opt_name) {
1349 $name = str_replace(
'.',
'_', $opt_name);
1350 require_once SQ_ATTRIBUTES_PATH.
'/option_list/option_list.inc';
1352 $opts->_edit_params[
'allow_reorder'] = FALSE;
1353 $opts->delimiter =
',';
1354 $opts->process($prefix.
'_fluster_opt_'.$name);
1355 $data[$opt_name] = $opts->value;
1359 if (!empty($data)) {
1360 $status = $asset->writeConfiguration($fluster_config, $data,
'fluster');
1383 function paintMetamapChooser(&$asset, &$o, $prefix)
1385 $wa = $asset->writeAccess(
'attributes');
1386 $collections = $asset->getCollections();
1387 $collection_selecter = Array();
1388 $current_choice = array_get_index($_POST, $prefix.
'_edit_metadata',
'');
1389 foreach ($collections as $id => $collection) {
1390 $collection_selecter[$id] = array_get_index($collection,
'name',
'');
1392 ksort($collection_selecter);
1395 if (!empty($collection_selecter)) {
1396 echo combo_box($prefix.
'_edit_metadata', $collection_selecter, FALSE, $current_choice);
1398 echo translate(
'funnelback_no_collection_to_proceed');
1417 function processMetamapChooser(&$asset, &$o, $prefix)
1436 function paintMetamap(&$asset, &$o, $prefix)
1438 $wa = $asset->writeAccess(
'attributes');
1439 $collections = $asset->getCollections();
1440 $collection_id = array_get_index($_POST, $prefix.
'_edit_metadata',
'');
1441 if ($wa && !empty($collection_id) && isset($collections[$collection_id])) {
1442 $coll_conf_path = $asset->getCollectionDataPath($collection_id,
'conf');
1443 $metadata_config = $coll_conf_path.
'/metamap.cfg';
1444 $metamap_config = $asset->attr(
'metamap');
1445 $config = array_get_index($metamap_config, $collection_id, Array());
1446 if (empty($config)) {
1447 if (!file_exists($metadata_config)) {
1449 $asset->createCollectionConfig($metadata_config,
'metadata');
1451 $config = $asset->readConfiguration($metadata_config,
'metadata',
',');
1453 if (!empty($config)) {
1455 hidden_field($prefix.
'_metamap_collection_id', $collection_id);
1457 <table
class=
"sq-backend-table">
1459 <td
class=
"sq-backend-table-header" width=
"15%"><?php echo translate(
'funnelback_mclass'); ?></td>
1460 <td
class=
"sq-backend-table-header" width=
"15%"><?php echo translate(
'funnelback_word_logic'); ?></td>
1461 <td
class=
"sq-backend-table-header" width=
"15%"><?php echo translate(
'funnelback_flag'); ?></td>
1462 <td
class=
"sq-backend-table-header" width=
"60%"><?php echo translate(
'funnelback_tag_name'); ?></td>
1463 <td
class=
"sq-backend-table-header" width=
"5%"><?php echo translate(
'delete'); ?></td>
1466 <td
class=
"sq-backend-table-row"><?php echo translate(
'fb_mclass',
'S'); ?></td>
1467 <td
class=
"sq-backend-table-row" colspan=
"5"><?php echo translate(
'funnelback_reserved_class'); ?></td>
1470 $alias_options = $asset->getMetadataAliases();
1471 $flag_options = Array(0=>translate(
'fb_noindex'),1=>translate(
'fb_index'));
1472 $word_logic_options = Array(
1473 0 => translate(
'fb_logic_exclude'),
1474 1 => translate(
'fb_logic_include_any'),
1475 2 => translate(
'fb_logic_include_all'),
1478 if (isset($alias_options[
'S'])) unset($alias_options[
'S']);
1480 $alias_word_logic = Array();
1481 $metadata_class_count = 0;
1482 foreach ($config as $line) {
1483 $alias = array_get_index($line,
'alias',
'');
1484 $content = array_get_index($line,
'content',
'');
1485 $metatag = array_get_index($line,
'metatag',
'');
1486 $word_logic = array_get_index($line,
'word_logic', 2);
1487 $system = array_get_index($line,
'system', FALSE);
1492 if ($alias ==
'S') {
1497 echo
'<td class="sq-table-row">';
1499 echo $alias_options[$alias];
1500 hidden_field($prefix.
'_metamap_alias[]', $alias);
1502 combo_box($prefix.
'_metamap_alias[]', $alias_options, FALSE, $alias);
1505 echo
'<td class="sq-table-row">';
1506 if (!isset($alias_word_logic[$alias])) {
1507 combo_box($prefix.
'_metamap_word_logic[]', $word_logic_options, FALSE, $word_logic);
1508 $alias_word_logic[$alias] = $word_logic;
1510 echo $word_logic_options[$alias_word_logic[$alias]];
1511 hidden_field($prefix.
'_metamap_word_logic[]', $alias_word_logic[$alias]);
1514 echo
'<td class="sq-table-row">';
1516 echo $flag_options[$content];
1517 hidden_field($prefix.
'_metamap_content[]', $content);
1519 combo_box($prefix.
'_metamap_content[]', $flag_options, FALSE, $content);
1522 echo
'<td class="sq-table-row">';
1525 hidden_field($prefix.
'_metamap_metatag[]', $metatag);
1527 text_box($prefix.
'_metamap_metatag[]', $metatag, 30);
1529 hidden_field($prefix.
'_metamap_system[]', (
string) $system);
1531 echo
'<td class="sq-table-row">';
1533 hidden_field($prefix.
'_metamap_delete['.$metadata_class_count.
']',
'0');
1535 check_box($prefix.
'_metamap_delete['.$metadata_class_count.
']',
'1');
1540 $metadata_class_count++;
1544 for ($i=0; $i<2; $i++) {
1546 echo
'<td class="sq-table-row">';
1547 combo_box($prefix.
'_metamap_alias[]', $alias_options, FALSE,
'');
1549 echo
'<td class="sq-table-row">';
1550 combo_box($prefix.
'_metamap_word_logic[]', $word_logic_options, FALSE, 2);
1552 echo
'<td class="sq-table-row">';
1553 combo_box($prefix.
'_metamap_content[]', $flag_options, FALSE, 0);
1555 echo
'<td class="sq-table-row">';
1556 text_box($prefix.
'_metamap_metatag[]',
'', 30);
1557 hidden_field($prefix.
'_metamap_system[]',
'0');
1559 echo
'<td class="sq-table-row">';
1560 check_box($prefix.
'_metamap_delete['.($metadata_class_count+$i).
']',
'0');
1565 echo translate(
'funnelback_no_collection_selected');
1568 echo translate(
'funnelback_no_collection_selected');
1586 function processMetamap(&$asset, &$o, $prefix)
1589 $wa = $asset->writeAccess(
'attributes');
1591 $collection_id = array_get_index($_POST, $prefix.
'_metamap_collection_id',
'');
1592 if (!empty($collection_id)) {
1593 $coll_conf_path = $asset->getCollectionDataPath($collection_id,
'conf');
1594 $metamap_config = $coll_conf_path.
'/metamap.cfg';
1596 $alias = array_get_index($_POST, $prefix.
'_metamap_alias', Array());
1597 $content = array_get_index($_POST, $prefix.
'_metamap_content', Array());
1598 $metatags = array_get_index($_POST, $prefix.
'_metamap_metatag', Array());
1599 $word_logic = array_get_index($_POST, $prefix.
'_metamap_word_logic', Array());
1600 $system = array_get_index($_POST, $prefix.
'_metamap_system', Array());
1601 $delete = array_get_index($_POST, $prefix.
'_metamap_delete', Array());
1602 $metamap_word_logic = Array();
1604 foreach ($alias as $index => $mclass) {
1605 $metadata_class = $mclass;
1606 $metadata_index = array_get_index($content, $index, 0);
1607 $metadata_metag = array_get_index($metatags, $index,
'');
1608 $metadata_system = array_get_index($system, $index, FALSE);
1609 $metadata_delete = array_get_index($delete, $index,
'0');
1613 if (isset($metamap_word_logic[$mclass])) {
1614 $metadata_word_logic = $metamap_word_logic[$mclass];
1616 $metadata_word_logic = array_get_index($word_logic, $index, 2);
1617 $metamap_word_logic[$mclass] = $metadata_word_logic;
1620 if (!empty($metadata_metag) && !(!$metadata_system && $metadata_delete)) {
1622 'alias' => $metadata_class,
1623 'content' => $metadata_index,
1624 'metatag' => $metadata_metag,
1625 'word_logic' => $metadata_word_logic,
1626 'system' => $metadata_system,
1632 if (!empty($data)) {
1634 $config = $asset->attr(
'metamap');
1635 $config[$collection_id] = $data;
1636 $asset->setAttrValue(
'metamap', $config);
1637 $status = $asset->saveAttributes();
1639 $status = $asset->writeConfiguration($metamap_config, $data,
'metadata',
',');
1663 function paintPassword(&$asset, &$o, $prefix)
1665 $wa = $asset->writeAccess(
'attributes');
1667 require_once SQ_ATTRIBUTES_PATH.
'/password/password.inc';
1669 $password_field->paint($prefix, !$wa);
1686 function processPassword(&$asset, &$o, $prefix)
1689 $wa = $asset->writeAccess(
'attributes');
1691 require_once SQ_ATTRIBUTES_PATH.
'/password/password.inc';
1693 $result = $password_field->process($prefix);
1694 if ($result !== FALSE && $password_field->processed == TRUE) {
1695 $asset->setAttrValue(
'password', $password_field->value);
1696 $status = $asset->saveAttributes();
1701 $user = $asset->attr(
'user');
1702 if (!empty($user)) {
1703 $user_asset = $GLOBALS[
'SQ_SYSTEM']->am->getAsset($user,
'', TRUE);
1704 if (!is_null($user_asset)) {
1705 if (!$user_asset->comparePassword($asset->attr(
'password'))) {
1706 trigger_localised_error(
'FNB0014', E_USER_WARNING);
1710 $GLOBALS[
'SQ_SYSTEM']->am->forgetAsset($user_asset, TRUE);
1733 function paintExcludeAssetid(&$asset, &$o, $prefix)
1735 $wa = $asset->writeAccess(
'attributes');
1736 $exclusions = array_get_index($asset->attr(
'global_exclude'),
'assetid', Array());
1738 multiple_asset_finder($prefix.
'_global_assetid_exclusions', $exclusions);
1740 if (empty($exclusions)) {
1741 echo translate(
'funnelback_no_assets');
1743 ?><ul style=
"margin:1px 15px;"><?php
1744 foreach ($exclusions as $assetid) {
1745 echo
'<li>'.get_asset_tag_line($assetid).
'</li>';
1766 function processExcludeAssetid(&$asset, &$o, $prefix)
1768 $wa = $asset->writeAccess(
'attributes');
1769 $exclusions = $asset->attr(
'global_exclude');
1770 $user_set = array_get_index($_POST, $prefix.
'_global_assetid_exclusions', Array());
1773 $global_assetid_exclude = Array();
1774 foreach ($user_set as $asset_info) {
1775 $assetid = array_get_index($asset_info,
'assetid', 0);
1776 if (empty($assetid))
continue;
1777 $global_assetid_exclude[] = $assetid;
1779 $exclusions[
'assetid'] = $global_assetid_exclude;
1780 $asset->setAttrValue(
'global_exclude', $exclusions);
1798 function paintExcludeAssetType(&$asset, &$o, $prefix)
1800 $wa = $asset->writeAccess(
'attributes');
1801 $exclusions = array_get_index($asset->attr(
'global_exclude'),
'type', Array());
1803 asset_type_chooser($prefix.
'_global_type_exclusions', TRUE, $exclusions);
1806 if (empty($exclusions)) {
1807 echo
'<p class="sq-backend-warning">'.translate(
'funnelback_no_asset_types_selected').
'</p>';
1809 $type_names = $GLOBALS[
'SQ_SYSTEM']->am->getTypeInfo($exclusions,
'name');
1810 ?><ul style=
"margin:1px 15px;"><?php
1811 foreach ($exclusions as $type) {
1813 echo get_asset_type_icon($type);
1814 echo $type_names[$type];
1836 function processExcludeAssetType(&$asset, &$o, $prefix)
1838 $wa = $asset->writeAccess(
'attributes');
1839 $exclusions = $asset->attr(
'global_exclude');
1840 $user_set = array_get_index($_POST, $prefix.
'_global_type_exclusions', Array());
1844 foreach ($user_set as $type_code) {
1845 if (empty($type_code))
continue;
1846 $types[] = $type_code;
1848 $exclusions[
'type'] = $types;
1849 $asset->setAttrValue(
'global_exclude', $exclusions);
1867 function paintExcludeTreeNode(&$asset, &$o, $prefix)
1869 $wa = $asset->writeAccess(
'attributes');
1870 $exclusions = array_get_index($asset->attr(
'global_exclude'),
'tree', Array());
1872 multiple_asset_finder($prefix.
'_global_tree_exclusions', $exclusions);
1874 if (empty($exclusions)) {
1875 echo translate(
'funnelback_no_root_nodes');
1877 ?><ul style=
"margin:1px 15px;"><?php
1878 foreach ($exclusions as $assetid) {
1879 echo
'<li>'.get_asset_tag_line($assetid).
'</li>';
1900 function processExcludeTreeNode(&$asset, &$o, $prefix)
1902 $wa = $asset->writeAccess(
'attributes');
1903 $exclusions = $asset->attr(
'global_exclude');
1904 $user_set = array_get_index($_POST, $prefix.
'_global_tree_exclusions', Array());
1907 $global_tree_exclude = Array();
1908 foreach ($user_set as $asset_info) {
1909 $assetid = array_get_index($asset_info,
'assetid', 0);
1910 if (empty($assetid))
continue;
1911 $global_tree_exclude[] = $assetid;
1913 $exclusions[
'tree'] = $global_tree_exclude;
1914 $asset->setAttrValue(
'global_exclude', $exclusions);
1934 function _checkCollection($collections, $collection_id=
'')
1936 foreach ($collections as $coll_id => $coll_info) {
1938 if (!empty($collection_id) && $collection_id != $coll_id) {
1943 $assetid = array_get_index($coll_info,
'asset', 0);
1944 $collection_url = array_get_index($coll_info,
'url', Array());
1945 if (!empty($assetid)) {
1946 $asset = $GLOBALS[
'SQ_SYSTEM']->am->getAsset($assetid);
1947 if (!is_null($asset)) {
1948 $poss_urls = $asset->getURLs();
1949 foreach ($poss_urls as $poss_url) {
1950 $http = array_get_index($poss_url,
'http', FALSE);
1951 $https = array_get_index($poss_url,
'https', FALSE);
1952 $burl = array_get_index($poss_url,
'url',
'');
1953 if ($http && !empty($burl)) {
1954 $url_to_check =
'http://'.$burl;
1956 if (in_array($url_to_check, $collection_url)) {
1957 $collections[$coll_id][
'valid'] = TRUE;
1960 if ($https && !empty($burl)) {
1961 $url_to_check =
'https://'.$burl;
1963 if (in_array($url_to_check, $collection_url)) {
1964 $collections[$coll_id][
'valid'] = TRUE;
1968 $GLOBALS[
'SQ_SYSTEM']->am->forgetAsset($coll_asset, TRUE);
1973 if (!empty($collection_id)) {
1975 if (isset($collections[$collection_id]) && array_get_index($collections[$collection_id],
'valid', FALSE)) {
1982 return $collections;
1996 function _getCollectionDefault($type=
'web')
2000 'settings' => Array(),
2005 $default[
'collections'] = Array();
2027 function _writeFeaturePagesConfiguration(&$asset, $collection, $data)
2029 $validData = Array();
2031 foreach ($data as $line) {
2032 $trigger = array_get_index($line,
'trigger',
'');
2033 $url = array_get_index($line,
'url',
'');
2034 $valid = array_get_index($line,
'valid', FALSE);
2035 if ($trigger !=
'' && $url !=
'' && $valid === TRUE) {
2037 $validData[] = $line;
2041 $configFile = $asset->getCollectionDataPath($collection,
'conf').
'/best_bets.cfg';
2042 $asset->writeConfiguration($configFile, $validData,
'feature',
'==');