17 require_once SQ_INCLUDE_PATH.
'/asset_edit/asset_edit_fns.inc';
42 parent::__construct();
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']);
71 $customised = array_keys($asset->getAssetWeightings());
106 $write_access = $asset->writeAccess(
'attributes');
109 $global_customised = $asset->getAssetTreeWeightings();
111 $root_folder_assetid = $GLOBALS[
'SQ_SYSTEM']->am->getSystemAssetid(
'root_folder');
112 if (isset($global_customised[$root_folder_assetid])) {
113 unset($global_customised[$root_folder_assetid]);
119 if (!empty($assetid)) {
123 return $write_access;
140 if ($this->_usingGoButton($prefix))
return FALSE;
158 $weights = $asset->getMetadataWeightings();
176 $weights = $asset->getMetadataWeightings();
178 $asset->saveMetadataWeightings($weights);
198 $root_folder_assetid = $GLOBALS[
'SQ_SYSTEM']->am->getSystemAssetid(
'root_folder');
199 $global_customised = $asset->getAssetTreeWeightings($root_folder_assetid);
200 $customised = (isset($global_customised[
'type_weights'])) ? array_keys($global_customised[
'type_weights']) : Array();
219 if ($this->_usingGoButton($prefix))
return FALSE;
239 $write_access = $asset->writeAccess(
'attributes');
240 $tree_type = array_get_index($_POST, $prefix.
'_selected_tree_type',
'');
243 return $write_access;
245 $o->addHiddenField($prefix.
'_current_assetid', $assetid);
248 $weights = $asset->getAssetTreeWeightings($assetid);
249 $tree_type = array_get_index($_POST, $prefix.
'_selected_tree_type',
'');
252 $o->openField(translate(
'sch_customise').
'?');
254 'asset_type' => translate(
'asset_types'),
255 'metadata' => translate(
'metadata'),
257 combo_box($prefix.
'_selected_tree_type', $types, FALSE, $tree_type);
259 submit_button($prefix.
'_selected_tree_type_go', translate(
'go'),
'main_form.submit()');
264 $key = array_get_index($_POST, $prefix.
'_current_assetid',
'');
266 return $write_access;
269 if (!empty($tree_type)) {
270 if ($tree_type ==
'asset_type') {
272 if ($paint_customised) {
273 $customised = isset($weights[
'type_weights']) ? array_keys($weights[
'type_weights']) : Array();
275 $customised = Array();
277 $weights = isset($weights[
'type_weights'][$type_code]) ? $weights[
'type_weights'][$type_code] : Array();
280 $metadata_weights = array_get_index($weights,
'metadata_weights', Array());
284 return $write_access;
302 $write_access = $asset->writeAccess(
'attributes');
303 $o->openSection(translate(
'sch_asset_weightings'));
306 <table
class=
"sq-backend-table" style=
"width:50%">
308 <td width=
"250" class=
"sq-backend-table-header"><?php echo translate(
'sch_weighting_component'); ?></td>
309 <td
class=
"sq-backend-table-header"><?php echo translate(
'sch_weighting'); ?></td>
310 <td
class=
"sq-backend-table-header"><?php echo translate(
'sch_indexed'); ?>?</td>
314 $components = $asset->getIndexableAssetComponents();
316 foreach ($components as $comp => $name) {
317 $weight = (isset($weights[$comp][
'weight'])) ? $weights[$comp][
'weight'] : 1;
318 $indexed = (isset($weights[$comp][
'indexed'])) ? $weights[$comp][
'indexed'] : 1;
321 <td
class=
"sq-backend-table-cell">
324 <td
class=
"sq-backend-table-cell">
327 text_box($prefix.
'_asset_weights['.$comp.
'][weight]', $weight, 5);
333 <td
class=
"sq-backend-table-cell">
336 check_box($prefix.
'_asset_weights['.$comp.
'][indexed]', 1, $indexed);
338 echo ($indexed) ? translate(
'yes') : translate(
'no');
351 return $write_access;
370 $write_access = $asset->writeAccess(
'attributes');
371 $attrs = $asset->getIndexableAttributes($type_code);
373 if (!empty($attrs)) {
374 $o->openSection(translate(
'sch_attribute_weightings'));
377 <table
class=
"sq-backend-table" style=
"width:50%">
379 <td width=
"250" class=
"sq-backend-table-header"><?php echo translate(
'sch_weighting_attribute'); ?></td>
380 <td
class=
"sq-backend-table-header"><?php echo translate(
'sch_weighting'); ?></td>
381 <td
class=
"sq-backend-table-header"><?php echo translate(
'sch_indexed'); ?>?</td>
385 foreach ($attrs as $name => $info) {
389 if ($name ==
'name' || $name ==
'short_name') {
393 $type = $info[
'type'];
394 $weight = (isset($weights[$name][
'weight'])) ? $weights[$name][
'weight'] : 1;
395 $indexed = (isset($weights[$name][
'indexed'])) ? $weights[$name][
'indexed'] : 1;
398 <td
class=
"sq-backend-table-cell">
399 <?php echo ucwords(str_replace(
'_',
' ', $name)); ?>
401 <td
class=
"sq-backend-table-cell">
404 text_box($prefix.
'_attr_weights['.$name.
'][weight]', $weight, 5);
410 <td
class=
"sq-backend-table-cell">
413 check_box($prefix.
'_attr_weights['.$name.
'][indexed]', 1, $indexed);
415 echo ($indexed) ? translate(
'yes') : translate(
'no');
429 return $write_access;
447 $write_access = $asset->writeAccess(
'attributes');
448 $valid_types = Array(
449 'metadata_schema' =>
'I',
450 'metadata_section' =>
'I',
451 'metadata_field' =>
'D',
454 $o->openSection(translate(
'sch_metadata_weightings'));
457 <table
class=
"sq-backend-table" style=
"width:60%">
459 <td
class=
"sq-backend-table-header"><?php echo translate(
'sch_metadata_asset'); ?></td>
460 <td
class=
"sq-backend-table-cell">
461 <?php asset_finder($prefix.
'_metadata_asset', 0, $valid_types); ?>
465 <td
class=
"sq-backend-table-header"><?php echo translate(
'sch_weighting'); ?></td>
466 <td
class=
"sq-backend-table-cell">
467 <?php text_box($prefix.
'_metadata_weight', 1, 5); ?>
476 $o->openSection(translate(
'sch_metadata_asset_weightings'));
478 if (!empty($weights)) {
480 <table
class=
"sq-backend-table" style=
"width:60%">
482 <td
class=
"sq-backend-table-header"><?php echo translate(
'assetid'); ?></td>
483 <td
class=
"sq-backend-table-header"><?php echo translate(
'sch_metadata_asset_name'); ?></td>
484 <td
class=
"sq-backend-table-header"><?php echo translate(
'asset_type'); ?></td>
485 <td
class=
"sq-backend-table-header"><?php echo translate(
'sch_weighting'); ?></td>
486 <td
class=
"sq-backend-table-header"><?php echo translate(
'sch_indexed'); ?>?</td>
489 echo
'<td class="sq-backend-table-header">'.translate(
'sch_remove').
'?</td>';
495 foreach ($weights as $assetid => $info) {
497 $type_name = $GLOBALS[
'SQ_SYSTEM']->am->getTypeInfo($info[
'type_code'],
'name');
498 $asset_info = $GLOBALS[
'SQ_SYSTEM']->am->getAssetInfo(Array($assetid), Array(), TRUE,
'name');
499 $indexed = (isset($weights[$assetid][
'indexed'])) ? $weights[$assetid][
'indexed'] : 1;
500 $asset_name = !empty($asset_info[$assetid]) ? $asset_info[$assetid] :
"<span style='color:red'>(".translate(
'asset_not_found_no_id').
")</span>";
503 <td
class=
"sq-backend-table-cell">
504 <?php echo $assetid; ?>
506 <td
class=
"sq-backend-table-cell">
507 <?php echo $asset_name; ?>
509 <td
class=
"sq-backend-table-cell" border=
"0">
510 <?php echo $type_name; ?>
512 <td
class=
"sq-backend-table-cell">
515 text_box($prefix.
'_metadata_assets['.$assetid.
'][weight]', $info[
'weight'], 5);
517 echo $info[
'weight'];
521 <td
class=
"sq-backend-table-cell">
524 echo check_box($prefix.
'_metadata_assets['.$assetid.
'][indexed]', 1, $indexed);
526 echo ($indexed) ? translate(
'yes') : translate(
'no');
532 echo
'<td class="sq-backend-table-cell">';
533 echo check_box($prefix.
'_metadata_assets['.$assetid.
'][remove]', 1, FALSE);
544 echo translate(
'sch_no_metadata_customised');
549 return $write_access;
567 $asset_types = $GLOBALS[
'SQ_SYSTEM']->am->getAssetTypes(TRUE);
569 $all_types = Array();
570 foreach ($asset_types as $type_code => $info) {
571 $all_types[$type_code] = $info[
'name'];
572 $type_anc = $GLOBALS[
'SQ_SYSTEM']->am->getTypeAncestors($type_code);
574 foreach ($type_anc as $anc_type_code) {
575 if ($anc_type_code ==
'asset')
continue;
577 if (!in_array($anc_type_code, array_keys($all_types))) {
578 $all_types[$anc_type_code] = $GLOBALS[
'SQ_SYSTEM']->am->getTypeInfo($anc_type_code,
'name');
582 $all_types = array_unique($all_types);
584 $all_types[
'asset'] =
'-- '.translate(
'sch_all_asset_types').
' --';
586 $all_types = array_reverse($all_types);
588 combo_box($field_name, $all_types, FALSE, $selected_type_code);
590 submit_button($field_name.
'_go', translate(
'go'),
'main_form.submit()');
609 $write_access = $asset->writeAccess(
'attributes');
610 if ($screen ==
'asset_type') {
611 $o->openField(translate(
'sch_choose_type_code'));
616 if (!empty($current_customisation)) {
617 if ($current_customisation ==
'asset') {
618 echo translate(
'sch_all_asset_types');
620 echo $GLOBALS[
'SQ_SYSTEM']->am->getTypeInfo($current_customisation,
'name');
625 }
else if ($screen ==
'asset') {
627 $o->openField(translate(
'sch_choose_assetid'));
629 asset_finder($prefix.
'_selected_assetid'.$field_suffix, $current_customisation, Array());
654 if (empty($weights))
return;
655 $write_access = $asset->writeAccess(
'attributes');
657 $o->openSection(
'Current customisations');
660 <table
class=
"sq-backend-table" style=
"width:60%">
664 if ($screen !=
'asset_type') {
665 ?><td
class=
"sq-backend-table-header"><?php echo translate(
'assetid'); ?></td><?php
667 $type_col_name = ($screen ==
'asset') ?
'asset_name' :
'asset_type';
669 <td
class=
"sq-backend-table-header"><?php echo translate($type_col_name); ?></td>
672 echo
'<td class="sq-backend-table-header">'.translate(
'sch_remove').
'?</td>';
677 foreach ($weights as $key) {
679 $css_class =
'sq-backend-table-cell';
680 if ($key == $current_key) $css_class .=
'-alt';
685 $field = $prefix.
'_customise_'.$post_field;
686 $o->addHiddenField($field,
'');
687 $src =
'Javascript: document.getElementById(\''.$field.
'\').value = \
''.$key.
'\';
';
688 $src .= 'main_form.submit()
';
692 if ($screen != 'asset_type
') $key_name = $key; // assetid
693 $type_name = $this->_getDisplayName($key, $screen);
695 // we only paint the section for the assetid if we are
696 // printing non-asset_type screens
697 if ($screen != 'asset_type
') {
699 <td class="<?php echo $css_class; ?>">
700 <?php echo $key_name; ?>
705 <td class="<?php echo $css_class; ?>">
706 <a href="<?php echo $src?>"><?php echo $type_name; ?></a>
711 <td class="<?php echo $css_class; ?>">
712 <?php echo check_box($field.'_remove[
'.$key.']
', 1, FALSE); ?>
727 }//end _paintCurrentCustomisations()
739 function _getDisplayName($key, $screen)
741 if (empty($key)) return '';
743 if ($screen != 'asset_type
') {
744 $info = $GLOBALS['SQ_SYSTEM
']->am->getAssetInfo(Array($key), Array(), TRUE);
745 $type_name = $info[$key]['name
'];
747 // if the key is 'asset
' then we are processing all asset types
748 if ($key != 'asset
') {
749 $type_name = $GLOBALS['SQ_SYSTEM
']->am->getTypeInfo($key, 'name
');
751 $type_name = translate('sch_all_asset_types
');
756 }//end _getDisplayName()
768 function _getCurrentCustomisation($prefix, $screen)
770 $post_field = $this->_getPostField($screen);
771 $key = array_get_index($_POST, $prefix.'_selected_
'.$post_field, '');
773 // if the screen requires an asset finder, extract the
774 // assetid into $key from the info posted from the asset finder
775 if ($post_field == 'assetid
') {
776 $key = isset($key['assetid
']) ? $key['assetid
'] : '';
778 // if there was nothing selected to customise, check for a current customisation in process
780 $key = array_get_index($_POST, $prefix.'_current_
'.$post_field, '');
783 // check to see if a current customisation was selected
784 if (isset($_POST[$prefix.'_customise_
'.$post_field]) && !empty($_POST[$prefix.'_customise_
'.$post_field])) {
785 $key = $_POST[$prefix.'_customise_
'.$post_field];
789 }//end _getCurrentCustomisation()
800 function _getPostField($screen)
802 $post_fields = Array(
803 'asset_tree
' => 'assetid
',
804 'asset
' => 'assetid
',
805 'asset_type
' => 'type_code
',
806 'metadata
' => 'assetid
',
808 return $post_fields[$screen];
810 }//end _getPostField()
827 function _paintWeightInterface(&$asset, &$o, $prefix, $screen, $customised=Array(), $weights=NULL)
829 $write_access = $asset->writeAccess('attributes
');
830 $post_field = $this->_getPostField($screen);
831 $key = $this->_getCurrentCustomisation($prefix, $screen);
833 // section opened by xml
834 $this->_paintCurrentCustomisations($asset, $o, $prefix, $customised, $screen);
835 $this->_paintWeightingSourceInterface($asset, $o, $prefix, $screen);
838 // if any customisations have been removed, dont show the weighting interface
839 // as the previous interface shown may have been for a removed customisation
840 if ($this->_customisationsRemoved($prefix, $screen)) {
841 return $write_access;
844 $o->openSection(translate('sch_
'.$screen.'_management
'));
847 // obtain the current weightings for this screen
848 $fn = 'get'.str_replace('_
', '', $screen).'weightings
';
849 if (is_null($weights)) $weights = $asset->$fn($key);
851 if ($post_field == 'type_code
') {
854 $asset_info = $GLOBALS['SQ_SYSTEM
']->am->getAssetInfo(Array($key), Array(), TRUE);
855 $type_code = $asset_info[$key]['type_code
'];
858 $o->openField(translate('sch_indexing_enabled
'));
860 if (isset($weights['indexed
'])) {
861 $indexed = $weights['indexed
'];
866 1 => translate('yes
'),
867 0 => translate('no
'),
870 combo_box($prefix.'_indexed
', $options, FALSE, $indexed);
872 echo $options[$indexed];
876 $asset_weights = array_get_index($weights, 'asset_weights
', Array());
877 $attr_weights = array_get_index($weights, 'attr_weights
', Array());
878 $metadata_weights = array_get_index($weights, 'metadata_weights
', Array());
880 $this->_paintAssetWeightInterface($asset, $o, $prefix, $asset_weights);
881 $this->_paintAttributeWeightInterface($asset, $o, $prefix, $attr_weights, $type_code);
882 $this->_paintMetadataWeightInterface($asset, $o, $prefix, $metadata_weights);
884 if (!$this->_customisationsRemoved($prefix, $screen)) {
885 $o->addHiddenField($prefix.'_current_
'.$post_field, $key);
887 }//end if !empty(assetid)
889 // section closed by xml
891 return $write_access;
893 }//end _paintWeightInterface()
907 function _processWeights(&$asset, &$o, $prefix, $screen)
909 if (!$asset->writeAccess('attributes
')) return FALSE;
910 $post_field = $this->_getPostField($screen);
912 // if they have clicked on a current customisation, dont process
913 if (!empty($_POST[$prefix.'_customise_type_code
']) || !empty($_POST[$prefix.'_customise_assetid
'])) {
917 $function_suffix = str_replace('_
', '', $screen).'Weightings
';
918 $get_function = 'get'.$function_suffix;
919 $save_function = 'save
'.$function_suffix;
921 $key = array_get_index($_POST, $prefix.'_current_
'.$post_field, '');
922 $weights = $asset->$get_function();
925 // the asset tree screen is a bit special - we need to dig down the
926 // array depending on what we are customising
927 if ($screen == 'asset_tree
') {
929 if (!isset($weights[$key])) $weights[$key] = Array();
930 $tree_assetid = $key;
931 $tree_weights = $weights;
932 $weights = $weights[$key];
934 $tree_type = array_get_index($_POST, $prefix.'_selected_tree_type
', '');
936 if (empty($tree_type)) return;
938 if ($tree_type == 'asset_type
') {
939 $type_code = array_get_index($_POST, $prefix.'_current_type_code
', '');
940 if (!empty($type_code)) {
941 // the key will be the type code within the asset tree array
942 // that we are currently customising
944 if (!isset($weights['type_weights
'])) {
945 $weights['type_weights
'] = Array();
947 $weights = $weights['type_weights
'];
949 // remove any asset type customisatons or tree customisations that have
950 // be flagged for removal
951 $this->_removeUnwantedCustomisations($prefix, 'asset_type
', $weights['type_weights
']);
952 $tree_weights[$key] = $weights;
953 $this->_removeUnwantedCustomisations($prefix, $screen, $tree_weights);
954 $asset->$save_function($tree_weights);
958 // we are setting metadata weights for assets underneath 'key
', which
959 // is stored in the global section for the asset tree that we are customising
960 if (!isset($weights['metadata_weights
'])) {
961 $weights['metadata_weights
'] = Array();
963 $this->_processMetadataWeights($prefix, $weights['metadata_weights
']);
964 $tree_weights[$tree_assetid] = $weights;
965 $asset->$save_function($tree_weights);
967 // no more work to do so just return
972 if (!isset($weights[$key])) $weights[$key] = Array();
974 foreach (Array('asset_weights
', 'attr_weights
', 'metadata_weights
') as $index) {
975 if (!isset($weights[$key][$index])) {
976 $weights[$key][$index] = Array();
980 // set the 1 if there is no 'indexed
' value set
981 $indexed = array_get_index($_POST, $prefix.'_indexed
', 1);
982 $weights[$key]['indexed
'] = $indexed;
984 $this->_processAssetWeights($prefix, $weights[$key]['asset_weights
']);
985 $this->_processAttributeWeights($prefix, $weights[$key]['attr_weights
']);
986 $this->_processMetadataWeights($prefix, $weights[$key]['metadata_weights
']);
988 if ($screen == 'asset_tree
') {
989 // remove any asset type customisations that have been flagged for removal
990 $this->_removeUnwantedCustomisations($prefix, 'asset_type
', $weights);
991 // we only get into here if tree_type == asset_type
992 $tree_weights[$tree_assetid]['type_weights
'] = $weights;
993 $weights = $tree_weights;
997 if (!empty($weights)) {
998 // remove any unwanted customisations
999 $this->_removeUnwantedCustomisations($prefix, $screen, $weights);
1000 $asset->$save_function($weights);
1003 // we never save attributes
1006 }//end _processWeights()
1018 function _processAssetWeights($prefix, &$weights)
1020 $asset_weights = array_get_index($_POST, $prefix.'_asset_weights
', Array());
1022 foreach ($asset_weights as $comp => $info) {
1023 // verify that all weights are positive
1024 if ($info['weight
'] <= 0) {
1025 if (!isset($weights[$comp]['weight
'])) {
1026 $asset_weights[$comp]['weight
'] = 1;
1028 $asset_weights[$comp]['weight
'] = (int) $weights[$comp]['weight
'];
1031 if (!isset($info['indexed
'])) {
1032 $asset_weights[$comp]['indexed
'] = 0;
1035 $weights = $asset_weights;
1037 }//end _processAssetWeights()
1049 function _processAttributeWeights($prefix, &$weights)
1051 $attr_weights = array_get_index($_POST, $prefix.'_attr_weights
', Array());
1052 foreach ($attr_weights as $name => $info) {
1053 // verify that all weights are positive
1054 if ($info['weight
'] <= 0) {
1055 if (!isset($weights[$name]['weight
'])) {
1056 $attr_weights[$name]['weight
'] = 1;
1058 $attr_weights[$name]['weight
'] = (int) $weights[$name]['weight
'];
1061 if (!isset($info['indexed
'])) {
1062 $attr_weights[$name]['indexed
'] = 0;
1065 $weights = $attr_weights;
1067 }//end _processAttributeWeights()
1079 function _processMetadataWeights($prefix, &$weights)
1081 // information about already added metadata assets
1082 $metadata_assets = array_get_index($_POST, $prefix.'_metadata_assets
', Array());
1084 // process any assets that have been previously added
1085 foreach ($metadata_assets as $assetid => $info) {
1086 if (isset($info['remove']) && $info['remove']) {
1087 unset($weights[$assetid]);
1089 $weight = ((int) $info['weight
'] > 0) ? $info['weight
'] : NULL;
1090 if (!is_null($weight)) {
1091 $weights[$assetid]['weight
'] = (int) $weight;
1093 $weights[$assetid]['indexed
'] = array_get_index($info, 'indexed
', FALSE);
1097 // the information posted by the asset finder
1098 $metadata_asset = array_get_index($_POST, $prefix.'_metadata_asset
', NULL);
1100 if (!is_null($metadata_asset) && $metadata_asset['assetid
'] != 0) {
1101 $weight = array_get_index($_POST, $prefix.'_metadata_weight
', 1);
1102 if ($weight < 0) $weight = 1;
1104 $assetid = $metadata_asset['assetid
'];
1105 $type_info = $GLOBALS['SQ_SYSTEM
']->am->getAssetInfo(Array($assetid), Array(), TRUE, 'type_code
');
1106 $type_code = $type_info[$assetid];
1108 // save any values from a metadata asset that was selected using the asset finder
1109 $weights[$assetid] = Array(
1110 'weight
' => (int) $weight,
1111 'type_code
' => $type_code,
1116 }//end _processMetadataWeights()
1129 function _removeUnwantedCustomisations($prefix, $screen, &$weights)
1131 $post_field = $this->_getPostField($screen);
1132 // remove any customisations that have been checked for removal
1133 $remove_array = array_get_index($_POST, $prefix.'_customise_
'.$post_field.'_remove
', Array());
1134 foreach ($remove_array as $key => $info) {
1135 unset($weights[$key]);
1138 }//end _removeUnwantedCustomisations()
1150 function _customisationsRemoved($prefix, $screen)
1152 $post_field = $this->_getPostField($screen);
1153 $removed = array_get_index($_POST, $prefix.'_customise_
'.$post_field.'_remove
', Array());
1155 return (!empty($removed));
1157 }//end _customisationsRemoved()
1170 function paintReindexing(&$asset, &$o, $prefix)
1172 if ($asset->writeAccess('attributes
')) {
1173 asset_finder($prefix.'_reindexing_root_assetid
', '');
1174 echo ' <b>
'.strtoupper(translate('or
')).'</b>
';
1176 $o->openField(translate('sch_system_wide
'));
1177 check_box($prefix.'_reindexing_root_folder
');
1178 echo translate('sch_reindex_all_assets
');
1183 }//end paintReindexing()
1196 function processReindexing(&$asset, &$o, $prefix)
1198 if (isset($_POST[$prefix.'_reindexing_root_assetid
']['assetid
'])) {
1199 $root_assetid = $_POST[$prefix.'_reindexing_root_assetid
']['assetid
'];
1200 if ($root_assetid > 0) {
1201 $hh = $GLOBALS['SQ_SYSTEM
']->getHipoHerder();
1202 $running_vars = Array(
1203 'root_assetid
' => $root_assetid,
1204 'contextid
' => $GLOBALS['SQ_SYSTEM
']->getContextId(),
1206 $hh->queueHipo('hipo_job_reindex
', $running_vars, '', SQ_PACKAGES_PATH.'/search/hipo_jobs
');
1211 if (isset($_POST[$prefix.'_reindexing_root_folder
'])) {
1212 // System-wide reindex.
1213 $hh = $GLOBALS['SQ_SYSTEM
']->getHipoHerder();
1214 $running_vars = Array(
1215 'root_assetid
' => $GLOBALS['SQ_SYSTEM
']->am->getSystemAssetid('root_folder
'),
1216 'contextid
' => $GLOBALS['SQ_SYSTEM
']->getContextId(),
1218 $hh->queueHipo('hipo_job_reindex
', $running_vars, '', SQ_PACKAGES_PATH.'/search/hipo_jobs
');
1223 }//end processReindexing()
1236 function paintNoiseWords(&$asset, &$o, $prefix)
1238 $write_access = $asset->writeAccess('attributes
');
1240 $noise_words = $asset->attr('noise_word_list
');
1241 $noise_words = (is_array($noise_words)) ? implode(' ', $noise_words) : '';
1243 if ($write_access) {
1244 text_area($prefix.'_noise_words
', $noise_words, 60, 5);
1248 return $write_access;
1250 }//end paintNoiseWords()
1263 function processNoiseWords(&$asset, &$o, $prefix)
1266 $words = array_get_index($_POST, $prefix.'_noise_words
', FALSE);
1269 $new_words = Array();
1271 if (preg_match_all('/\w+/i
', $words, $matches, PREG_SET_ORDER)) {
1272 foreach ($matches as $match) {
1273 $word = array_pop($match);
1274 $new_words[$word] = $word;
1278 $asset->setAttrValue('noise_word_list
', $new_words);
1282 }//end processNoiseWords()
1295 function paintWhiteWords(&$asset, &$o, $prefix)
1297 $write_access = $asset->writeAccess('attributes
');
1299 $words = $asset->attr('white_word_list
');
1300 $words = (is_array($words)) ? implode(' ', $words) : '';
1302 if ($write_access) {
1303 text_area($prefix.'_white_words
', $words, 60, 5);
1307 return $write_access;
1309 }//end paintWhiteWords()
1322 function processWhiteWords(&$asset, &$o, $prefix)
1324 $words = array_get_index($_POST, $prefix.'_white_words
', FALSE);
1327 $new_words = Array();
1329 if (preg_match_all('/\w+/i
', $words, $matches, PREG_SET_ORDER)) {
1330 foreach ($matches as $match) {
1331 $word = array_pop($match);
1332 $new_words[$word] = $word;
1336 $asset->setAttrValue('white_word_list
', $new_words);
1340 }//end processWhiteWords()
1352 function indexingOn(&$owner, $prefix)
1354 return $owner->attr('indexing
');
1364 private function _usingGoButton($prefix)
1366 $tree_type_go = array_get_index($_POST, $prefix.'_selected_tree_type_go
', FALSE);
1367 $type_code_go = array_get_index($_POST, $prefix.'_selected_type_code_go
', FALSE);
1369 return ($tree_type_go !== FALSE || $type_code_go !== FALSE);
1371 }// end _usingGoButton()