| 1 |
udo |
1.1 |
<? |
| 2 |
|
|
/** |
| 3 |
|
|
* This file contains the YAA_NewsEdit child class, it inherits |
| 4 |
|
|
* from the WebExplorer_Module_AbstractNavigationList. |
| 5 |
|
|
* |
| 6 |
|
|
* @author Udo Loeb <udo@rotamente.com> |
| 7 |
|
|
* @author Sebastian Utz <seut@rotamente.com> |
| 8 |
|
|
* @package org.netfrag.app |
| 9 |
|
|
* @name YAA::NewsEdit |
| 10 |
|
|
* |
| 11 |
|
|
*/ |
| 12 |
|
|
|
| 13 |
|
|
/** |
| 14 |
|
|
* Cvs-Log: |
| 15 |
|
|
* |
| 16 |
|
|
* $Id: JobGroups.php,v 1.1 2003/04/18 14:04:26 joko Exp $ |
| 17 |
|
|
* |
| 18 |
|
|
* |
| 19 |
|
|
*/ |
| 20 |
|
|
|
| 21 |
|
|
/** |
| 22 |
|
|
* This requires the WebExplorer::Module::DataList |
| 23 |
|
|
* component as base class. |
| 24 |
|
|
* |
| 25 |
|
|
*/ |
| 26 |
|
|
loadModule('WebExplorer::Module::DataList'); |
| 27 |
|
|
|
| 28 |
|
|
/** |
| 29 |
|
|
* The YAA_NewsEdit child class inherits from a WebExplorer |
| 30 |
|
|
* component to ensure querying against known api/infrastructure. |
| 31 |
|
|
* This could also be decoupled later. |
| 32 |
|
|
* |
| 33 |
|
|
* |
| 34 |
|
|
* |
| 35 |
|
|
* @copyright (c) 2003 - All Rights reserved. |
| 36 |
|
|
* |
| 37 |
|
|
* @link http://www.gnu.org/licenses/lgpl.txt |
| 38 |
|
|
* @license GNU LGPL (GNU Lesser General Public License) |
| 39 |
|
|
* |
| 40 |
|
|
* |
| 41 |
|
|
* @author Udo Loeb <udo@rotamente.com> |
| 42 |
|
|
* @author Sebastian Utz <seut@rotamente.com> |
| 43 |
|
|
* @package org.netfrag.app |
| 44 |
|
|
* @name YAA::NewsEdit |
| 45 |
|
|
* |
| 46 |
|
|
* |
| 47 |
|
|
*/ |
| 48 |
|
|
|
| 49 |
|
|
|
| 50 |
|
|
|
| 51 |
|
|
class YAA_NewsEdit extends WebExplorer_Module_DataList { |
| 52 |
|
|
|
| 53 |
|
|
function set_gui_object() { |
| 54 |
|
|
|
| 55 |
|
|
// the request determines, if |
| 56 |
|
|
|
| 57 |
|
|
$subtopic = $_REQUEST['subtopic']; |
| 58 |
|
|
|
| 59 |
|
|
if (!empty($_REQUEST['sub_lang'])) { |
| 60 |
|
|
$sub_lang = $_REQUEST['sub_lang'] . "*" . $_REQUEST['lang_show']; |
| 61 |
|
|
} |
| 62 |
|
|
|
| 63 |
|
|
$main = html_div(); |
| 64 |
|
|
|
| 65 |
|
|
if (!empty($sub_lang)) { |
| 66 |
|
|
$whichSub = array(); |
| 67 |
|
|
$whichSub = explode("*", $sub_lang); |
| 68 |
|
|
$whichSubtopic = $whichSub[0]; |
| 69 |
|
|
$whichLanguage = $whichSub[1]; |
| 70 |
|
|
|
| 71 |
|
|
if ($whichSubtopic == 1 || $whichSubtopic == 2 || $whichSubtopic == 3 ) { |
| 72 |
|
|
$editTextForm = new EditTextForm ('Upload new feed image', 600, $whichSubtopic, $whichLanguage, $this->_args[options]); |
| 73 |
|
|
$content = new FormProcessor($editTextForm, 'editTextForm', '', ""); |
| 74 |
|
|
} |
| 75 |
|
|
else { |
| 76 |
|
|
$EditPageForm = new EditPageForm ('found items form ' . $whichSubtopic . ":", 600, $whichSubtopic, $_REQUEST['lang_show'], $_REQUEST['lang_set'], $_REQUEST['undone'], $this->_args[options]); |
| 77 |
|
|
$content = new FormProcessor($EditPageForm, 'EditPageForm', '', ""); |
| 78 |
|
|
} |
| 79 |
|
|
} |
| 80 |
|
|
|
| 81 |
|
|
// the subtopic is passed from the VerticalCSSNavTable in Page_News - left_block() |
| 82 |
|
|
// at first another VerticalCSSNavTable will be displayed, so that the language of the |
| 83 |
|
|
// items can be selected. |
| 84 |
|
|
// this second VerticalCSSNavTable keeps the subtopic as a part of the key, which will be |
| 85 |
|
|
// passed as sub_lang |
| 86 |
|
|
// the only exception is the news-admin, which is the EditTextForm, because there we have |
| 87 |
|
|
// the additional option to select an image for the news. |
| 88 |
|
|
|
| 89 |
|
|
if (!empty($subtopic)) |
| 90 |
|
|
{ |
| 91 |
|
|
switch ($subtopic) { |
| 92 |
|
|
case 'upload': |
| 93 |
|
|
$uploadForm = new UploadForm ('Upload new feed image', 600); |
| 94 |
|
|
$content = new FormProcessor($uploadForm, 'UploadForm', '', "multipart/form-data"); |
| 95 |
|
|
break; |
| 96 |
|
|
case 'edit_feed1': |
| 97 |
|
|
case 'edit_feed2': |
| 98 |
|
|
case 'edit_feed3': |
| 99 |
|
|
$sub_de = substr($subtopic, 9, 1) . "*de"; |
| 100 |
|
|
$sub_en = substr($subtopic, 9, 1) . "*en"; |
| 101 |
|
|
$sub_tr = substr($subtopic, 9, 1) . "*tr"; |
| 102 |
|
|
|
| 103 |
|
|
$nav = array ($sub_de => "deutsch", $sub_en => "englisch", $sub_tr => "tuerkisch"); |
| 104 |
|
|
$comp = new VerticalCSSNavTable("Select Language", "", "100"); |
| 105 |
|
|
foreach ($nav as $subtopic => $label) { |
| 106 |
|
|
$comp->add("?t=News&sub_lang=$subtopic", $label, "Untergruppe $label ($subtopic) anzeigen"); |
| 107 |
|
|
} |
| 108 |
|
|
$content = $comp->render(); |
| 109 |
|
|
break; |
| 110 |
|
|
|
| 111 |
|
|
case 'searchKey': |
| 112 |
|
|
$languages = array("deutsch"=>"de", "englisch"=>"en", "tuerkisch"=>"tr"); |
| 113 |
|
|
|
| 114 |
|
|
$myForm = html_form("specify", $_SERVER['PHP_SELF'] . "?t=News" . "&sub_lang=" . $subtopic, "POST"); |
| 115 |
|
|
|
| 116 |
|
|
|
| 117 |
|
|
$table = html_table(400, 0, 2); |
| 118 |
|
|
$table->add_row("translate from:", form_select("lang_show", $languages)); |
| 119 |
|
|
$table->add_row(" to:", form_select("lang_set", $languages)); |
| 120 |
|
|
$table->add_row("only not translated :", form_radio("undone", "yes")); |
| 121 |
|
|
$table->add_row(" all :", form_radio("undone", "no")); |
| 122 |
|
|
$table->add_row("enter search-key :", form_text("sub_lang")); |
| 123 |
|
|
$table->add_row("submit :", form_submit("submit", "submit")); |
| 124 |
|
|
$myForm->add($table); |
| 125 |
|
|
|
| 126 |
|
|
$content = $myForm; |
| 127 |
|
|
|
| 128 |
|
|
|
| 129 |
|
|
break; |
| 130 |
|
|
default: |
| 131 |
|
|
$languages = array("deutsch"=>"de", "englisch"=>"en", "tuerkisch"=>"tr"); |
| 132 |
|
|
$myForm = html_form("specify", $_SERVER['PHP_SELF'] . "?t=News" . "&sub_lang=" . $subtopic, "POST"); |
| 133 |
|
|
$table = html_table(400, 0, 2); |
| 134 |
|
|
$table->add_row("translate from:", form_select("lang_show", $languages)); |
| 135 |
|
|
$table->add_row(" to:", form_select("lang_set", $languages)); |
| 136 |
|
|
$table->add_row("only not translated :", form_radio("undone", "yes")); |
| 137 |
|
|
$table->add_row(" all :", form_radio("undone", "no")); |
| 138 |
|
|
$table->add_row("submit :", form_submit("submit", "submit")); |
| 139 |
|
|
$myForm->add($table); |
| 140 |
|
|
|
| 141 |
|
|
$content = $myForm; |
| 142 |
|
|
} |
| 143 |
|
|
} |
| 144 |
|
|
$this->_gui_object = &$content; |
| 145 |
|
|
} |
| 146 |
|
|
|
| 147 |
|
|
} |
| 148 |
|
|
|
| 149 |
|
|
|
| 150 |
|
|
?> |