$menu = array('files/edit.php?anchor=' . urlencode('article:' . $item['id']) => i18n::s('Add a file')); $box .= Skin::build_list($menu, 'menu_bar'); } if ($items = Files::list_embeddable_for_anchor('article:' . $item['id'], 0, 50)) { $box .= Skin::build_list($items, 'decorated'); } if ($box) { $text .= Skin::build_box(i18n::s('Files'), $box, 'folded'); } // tables $box = ''; if ($cur_article->allows('creation', 'table')) { $menu = array('tables/edit.php?anchor=' . urlencode('article:' . $item['id']) => i18n::s('Add a table')); $box .= Skin::build_list($menu, 'menu_bar'); } if ($items = Tables::list_by_date_for_anchor('article:' . $item['id'], 0, 50, 'article:' . $item['id'])) { $box .= Skin::build_list($items, 'decorated'); } if ($box) { $text .= Skin::build_box(i18n::s('Tables'), $box, 'folded'); } } // display in a separate panel if ($text) { $panels[] = array('resources', i18n::s('Resources'), 'resources_panel', $text); } // // options tab is visible only to site associates // if (Surfer::is_associate()) { $text = '';
$menu = array('locations/edit.php?anchor=' . urlencode('section:' . $item['id']) => i18n::s('Add a location')); $box .= Skin::build_list($menu, 'menu_bar'); } if ($items = Locations::list_by_date_for_anchor('section:' . $item['id'], 0, 50, 'section:' . $item['id'])) { $box .= Skin::build_list($items, 'decorated'); } if ($box) { $text .= Skin::build_box(i18n::s('Locations'), $box, 'folded'); } // tables $box = ''; if (Tables::allow_creation($item, $anchor, 'section')) { $menu = array('tables/edit.php?anchor=' . urlencode('section:' . $item['id']) => i18n::s('Add a table')); $box .= Skin::build_list($menu, 'menu_bar'); } if ($items = Tables::list_by_date_for_anchor('section:' . $item['id'], 0, 50, 'section:' . $item['id'])) { $box .= Skin::build_list($items, 'decorated'); } if ($box) { $text .= Skin::build_box(i18n::s('Tables'), $box, 'folded'); } } // display in a separate panel if ($text) { $panels[] = array('resources', i18n::s('Resources'), 'resources_panel', $text); } // // options tab // $text = ''; // provide information to section owner, and to editors of parent section
// if we are editing an existing profile if (isset($item['id'])) { // files are reserved to authenticated members if ($items = Files::list_embeddable_for_anchor('user:'******'id'], 0, 50)) { $text .= Skin::build_box(i18n::s('Files'), Skin::build_list($items, 'decorated'), 'unfolded'); } // locations are reserved to authenticated members if (Locations::allow_creation($item, null)) { $menu = array('locations/edit.php?anchor=' . urlencode('user:'******'id']) => i18n::s('Add a location')); $items = Locations::list_by_date_for_anchor('user:'******'id'], 0, 50, 'user:'******'id']); $text .= Skin::build_box(i18n::s('Locations'), Skin::build_list($menu, 'menu_bar') . Skin::build_list($items, 'decorated'), 'folded'); } // tables are reserved to associates if (Tables::allow_creation($item, null)) { $menu = array('tables/edit.php?anchor=' . urlencode('user:'******'id']) => i18n::s('Add a table')); $items = Tables::list_by_date_for_anchor('user:'******'id'], 0, 50, 'user:'******'id']); $text .= Skin::build_box(i18n::s('Tables'), Skin::build_list($menu, 'menu_bar') . Skin::build_list($items, 'decorated'), 'folded'); } // pgp key // $label = i18n::s('PGP key or certificate'); // $input = '<textarea name="pgp_key" rows="5" cols="50">'.encode_field(isset($item['pgp_key'])?$item['pgp_key']:'').'</textarea>'; // add a folded box // $text .= Skin::build_box(i18n::s('Public key'), $label.BR.$input, 'folded'); // $fields = array(); } // display in a separate panel if ($text) { $panels[] = array('resources', i18n::s('Resources'), 'resources_panel', $text); } // let YACS do the hard job $context['text'] .= Skin::build_tabs($panels);