18 require_once SQ_PACKAGES_PATH.
'/cms/listing_engine/listing_engine_edit_fns.inc';
19 require_once SQ_LIB_PATH.
'/html_form/html_form.inc';
43 parent::__construct();
60 require_once SQ_INCLUDE_PATH.
'/general_occasional.inc';
61 $write_access = $asset->writeAccess(
'attributes');
63 $current = $asset->attr(
'link_types');
64 $link_types = get_link_type_names();
67 require_once SQ_LIB_PATH.
'/html_form/html_form.inc';
70 foreach ($link_types as $link_type => $link_type_name) {
71 if ($current & $link_type) {
72 $selected[] = $link_type;
76 combo_box($prefix.
'_link_types', $link_types, TRUE, $selected);
77 hidden_field($prefix.
'_link_types_submitted',
'1');
79 if (($current == 0) && ($asset->attr(
'subs_only'))){
80 echo
'<p class="sq-backend-warning">'.translate(
'cms_listing_no_link_types_selected').
'</p>';
83 foreach ($link_types as $link_type => $link_type_name) {
84 if ($current & $link_type) {
85 echo
'<li>'.$link_type_name.
'</li>';
110 if (!$asset->writeAccess(
'attributes'))
return FALSE;
111 if (empty($_POST[$prefix.
'_link_types_submitted']))
return FALSE;
114 if (isset($_POST[$prefix.
'_link_types'])) {
115 foreach ($_POST[$prefix.
'_link_types'] as $link_type) {
116 $link_types |= $link_type;
120 return $asset->setAttrValue(
'link_types', $link_types);