2012-12-31 Juan Manuel Ramon <juanmanuel.ramon@artica.es>

* godmode/tag/tag.php
	 godmode/tag/edit_tag.php: Tag editor compatible with metaconsole.
	 


git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7345 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
juanmanuelr 2012-12-31 09:02:10 +00:00
parent 2d0eeb0720
commit 415dd9901b
3 changed files with 46 additions and 17 deletions

View File

@ -1,3 +1,8 @@
2012-12-31 Juan Manuel Ramon <juanmanuel.ramon@artica.es>
* godmode/tag/tag.php
godmode/tag/edit_tag.php: Tag editor compatible with metaconsole.
2012-12-31 Juan Manuel Ramon <juanmanuel.ramon@artica.es>
* godmode/reporting/reporting_builder.php: Fixes in template

View File

@ -37,17 +37,30 @@ $url_tag = (string) get_parameter ("url_tag", "");
$email_tag = (string) get_parameter ("email_tag", "");
$tab = (string) get_parameter ("tab", "list");
if (defined('METACONSOLE'))
$sec = 'advanced';
else
$sec = 'gmodules';
$buttons = array(
'list' => array(
'active' => false,
'text' => '<a href="index.php?sec=gmodules&sec2=godmode/tag/tag&tab=list">' .
'text' => '<a href="index.php?sec='.$sec.'&sec2=godmode/tag/tag&tab=list">' .
html_print_image ("images/god6.png", true, array ("title" => __('List tags'))) .'</a>'));
$buttons[$tab]['active'] = true;
if (defined('METACONSOLE')) {
// Print header
ui_meta_print_header(__('Tags'), "", $buttons);
}
else {
// Header
ui_print_page_header (__('Tags configuration'), "images/setup.png", false, "", true, $buttons);
}
// Two actions can performed in this page: update and create tags
// Update tag: update an existing tag
if ($update_tag && $id_tag != 0) {
@ -125,7 +138,7 @@ else {
}
// Create/Update tag form
echo '<form method="post" action="index.php?sec=gmodules&sec2=godmode/tag/edit_tag&action=' . $action . '&id_tag=' . $id_tag . '" enctype="multipart/form-data">';
echo '<form method="post" action="index.php?sec='.$sec.'&sec2=godmode/tag/edit_tag&action=' . $action . '&id_tag=' . $id_tag . '" enctype="multipart/form-data">';
echo '<div align=left style="width: 98%" class="pandora_form">';

View File

@ -56,17 +56,32 @@ if (is_ajax ()) {
return;
}
if (defined('METACONSOLE'))
$sec = 'advanced';
else
$sec = 'gmodules';
$buttons = array(
'list' => array(
'active' => false,
'text' => '<a href="index.php?sec=galertas&sec2=godmode/tag/tag&tab=list">' .
'text' => '<a href="index.php?sec='.$sec.'&sec2=godmode/tag/tag&tab=list">' .
html_print_image ("images/god6.png", true, array ("title" => __('List tags'))) .'</a>'));
$buttons[$tab]['active'] = true;
if (defined('METACONSOLE')) {
// Print header
ui_meta_print_header(__('Tags'), "", $buttons);
}
else {
// Header
ui_print_page_header (__('Tags configuration'), "images/setup.png", false, "", true, $buttons);
}
// Two actions can performed in this page: search and delete tags
// Delete action: This will delete a tag
@ -106,7 +121,7 @@ echo "<td>";
echo '<b>' . __("Name") . "/" . __("Description") . '</b>';
echo "</td>";
echo "<td align=center>";
echo '<form method=post action="index.php?sec=gmodules&sec2=godmode/tag/tag&delete_tag=0">';
echo '<form method=post action="index.php?sec='.$sec.'&sec2=godmode/tag/tag&delete_tag=0">';
html_print_input_hidden ("search_tag", "1");
html_print_input_text ('tag_name', $tag_name, '', 30, 255, false);
echo "&nbsp;&nbsp;&nbsp;";
@ -114,7 +129,7 @@ echo "<td align=center>";
echo "</form>";
echo "</td>";
echo "<td align=right>";
echo '<form method="post" action="index.php?sec=gmodules&sec2=godmode/tag/edit_tag&action=new">';
echo '<form method="post" action="index.php?sec='.$sec.'&sec2=godmode/tag/edit_tag&action=new">';
html_print_input_hidden ("create_tag", "1", true);
html_print_submit_button (__('Create tag'), 'create_button', false, 'class="sub next"');
echo "</form>";
@ -158,26 +173,22 @@ if (!empty($result)) {
$data = array ();
$data[0] = "<a href='index.php?sec=gmodules&sec2=godmode/tag/edit_tag&action=update&id_tag=" . $tag["id_tag"] . "'>" . $tag["name"] . "</a>";
$data[0] = "<a href='index.php?sec=".$sec."&sec2=godmode/tag/edit_tag&action=update&id_tag=" . $tag["id_tag"] . "'>" . $tag["name"] . "</a>";
$data[1] = ui_print_truncate_text($tag["description"], 'description', false);
$data[2] = '<a href="' . $tag["url"] . '">' . $tag["url"] . '</a>';
$data[3] = ' <a class="tag_details"
href="ajax.php?page=godmode/tag/tag&get_tag_tooltip=1&id_tag=' . $tag['id_tag'] . '">' .
href="' . ui_get_full_url(false, false, false, false) . '/ajax.php?page=godmode/tag/tag&get_tag_tooltip=1&id_tag=' . $tag['id_tag'] . '">' .
html_print_image("images/zoom.png", true, array("id" => 'tag-details-'.$tag['id_tag'], "class" => "img_help")) . '</a> ';
$data[3] .= tags_get_modules_count($tag["id_tag"]);
$data[4] = $tag["email"];
$data[5] = "<a href='index.php?sec=gmodules&sec2=godmode/tag/edit_tag&action=update&id_tag=".$tag["id_tag"] . "'>" . html_print_image("images/config.png", true, array("title" => "Edit")) . "</a>&nbsp;&nbsp;";
$data[5] .= '<a href="index.php?sec=gmodules&sec2=godmode/tag/tag&delete_tag='.$tag["id_tag"] . '"onclick="if (! confirm (\''.__('Are you sure?').'\')) return false">' . html_print_image("images/cross.png", true, array("title" => "Delete")) . '</a>';
$data[5] = "<a href='index.php?sec=".$sec."&sec2=godmode/tag/edit_tag&action=update&id_tag=".$tag["id_tag"] . "'>" . html_print_image("images/config.png", true, array("title" => "Edit")) . "</a>&nbsp;&nbsp;";
$data[5] .= '<a href="index.php?sec='.$sec.'&sec2=godmode/tag/tag&delete_tag='.$tag["id_tag"] . '"onclick="if (! confirm (\''.__('Are you sure?').'\')) return false">' . html_print_image("images/cross.png", true, array("title" => "Delete")) . '</a>';
array_push ($table->data, $data);
}
html_print_table ($table);
}
else {
// No tags available or selected
echo "<div class='nf'>".__('No tags selected')."</div>";
}
ui_require_css_file ('cluetip');
ui_require_jquery_file ('cluetip');