示例#1
0
     //    $steam->set_attribute($picture, "bid:doctype", "portlet:picture");
     //    $steam->set_attribute($picture, "OBJ_DESC", $_FILES["picture"]["name"]);
 }
 if ($_POST["headline"] != "") {
     $msg->set_attribute("OBJ_NAME", norm_post("headline"));
 } else {
     $msg->set_attribute("OBJ_NAME", $language == "ge" ? "KEINE Überschrift gesetzt" : "NO headline set");
 }
 $msg->set_attribute("OBJ_DESC", norm_post("subheadline"));
 $msg->set_attribute("bid:portlet:msg:picture_alignment", isset($_POST["picture_alignment"]) ? $_POST["picture_alignment"] : "left");
 /** Check the picture width */
 $picture_width = isset($_POST["picture_width"]) ? $_POST["picture_width"] : "";
 $picture_width = check_width_string($picture_width, 5, 100, 5, $column_width - 25, "");
 $msg->set_attribute("bid:portlet:msg:picture_width", $picture_width);
 $msg->set_attribute("bid:portlet:msg:link_url", norm_post("link_url"));
 $msg->set_attribute("bid:portlet:msg:link_url_label", norm_post("link_url_label"));
 $msg->set_attribute("bid:portlet:msg:link_open", isset($_POST["link_open"]) ? $_POST["link_open"] == open ? "checked" : "" : "");
 $msg->set_content(stripslashes($_POST["content"]));
 $oldimage_id = $msg->get_attribute("bid:portlet:msg:picture_id");
 // new picture, no old one
 if (isset($picture_id) && ($oldimage_id == null || $oldimage_id == "")) {
     $msg->set_attribute("bid:portlet:msg:picture_id", $picture_id->get_id());
     unset($oldimage_id);
 } else {
     if (isset($picture_id) && $oldimage_id != $picture_id) {
         $msg->set_attribute("bid:portlet:msg:picture_id", $picture_id->get_id());
     } else {
         if (isset($picture_id) && $oldimage_id == $picture_id) {
             unset($oldimage_id);
         } else {
             if (!isset($picture_id) && !(isset($_POST["imageaction"]) && $_POST["imageaction"] == "delete")) {
示例#2
0
          Bastian Schröder <*****@*****.**>

  ****************************************************************************/
include "../../header.php";
$category = (int) isset($_GET["category"]) ? $_GET["category"] : (isset($_POST["category"]) ? $_POST["category"] : "");
$topic = (int) isset($_GET["topic"]) ? $_GET["topic"] : (isset($_POST["topic"]) ? $_POST["topic"] : "");
$content = $portlet_content;
//display stuff
$tpl = new Template("./templates/{$language}", "keep");
$tpl->set_file("content", "topic_edit.ihtml");
$tpl->set_block("content", "feedback_headline_null", "DUMMY");
$tpl->set_var(array("DUMMY" => "", "PORTAL_ID" => $portal->get_id(), "PORTAL_NAME" => $portal_name, "PORTLET_NAME" => $portlet_name, "PORTLET_ID" => $portlet->get_id(), "FEEDBACK" => "", "BUTTON_CANCEL_MISSION" => "", "BUTTON_CANCEL_URL" => "{$config_webserver_ip}/modules/portal2/portlets/topic/edit.php", "BUTTON_MISSION" => "save", "BUTTON_URL" => "{$config_webserver_ip}/modules/portal2/portlets/topic/topic_edit.php"));
//save stuff
if ($action == "save" && isset($content[$category])) {
    $action = "save return(portlets/topic/edit.php)";
    $new_content = array("title" => norm_post("title"), "description" => norm_post("description"), "link_url" => norm_post("link_url"), "link_target" => isset($_POST["link_target"]) ? "checked" : "");
    if ($topic == "") {
        $topic = array_push($content[$category]["topics"], $new_content) - 1;
    } else {
        $content[$category]["topics"][$topic] = $new_content;
    }
    //verify input
    if ($_POST["title"] == "") {
        $tpl->parse("FEEDBACK", "feedback_headline_null");
        $action = "";
    }
    $portlet_content = $content;
}
//if new category then leave all empty
$tpl->set_var("CATEGORY_ID", $category);
if ($action == "new") {
示例#3
0
文件: answer.php 项目: rolwi/koala
     $input_id = trim($entity["input_id"]);
     $tpl->set_var(array("QUESTION" => $numbering_string . nl2br(norm_post($entity["description"])), "QUESTION_STYLE" => $entity["must"] ? "bold" : "normal"));
     $tpl->unset_var("INPUT_GRADING_ROW");
     foreach ($entity["grading_options"] as $value => $text) {
         $tpl->set_var(array("INPUT_ID" => $input_id . "_" . $value, "GRADING_OPTION" => $text, "CSS_CLASS" => $value % 2 == 0 ? "grading_row_1" : "grading_row_2"));
         for ($i = 1; $i < 7; $i++) {
             $tpl->set_var("CHECKED_" . $i, isset($post[$input_id . "_" . $value]) && $post[$input_id . "_" . $value] == $i || $post[$input_id][$value] == $i ? 'checked="checked"' : "");
         }
         $tpl->parse("INPUT_GRADING_ROW", "input_grading_row", true);
     }
     $tpl->parse("INPUT_ELEMENT", "input_grading");
     $tpl->parse("QUEST_CELL", "question_align_top", true);
     break;
 case QUESTIONARY_INPUT_TENDENCY:
     $input_id = trim($entity["input_id"]);
     $tpl->set_var(array("QUESTION" => $numbering_string . nl2br(norm_post($entity["description"])), "QUESTION_STYLE" => $entity["must"] ? "bold" : "normal"));
     $tpl->unset_var("INPUT_TENDENCY_ROW");
     foreach ($entity["tendency_elements"] as $value => $text) {
         $checked = "";
         $tpl->set_var(array("TENDENCY_ELEMENT_A" => $text[0], "TENDENCY_ELEMENT_B" => $text[1], "CSS_CLASS" => $value % 2 == 0 ? "tendency_row_2" : "tendency_row_1"));
         $tpl->unset_var("INPUT_TENDENCY_CELL");
         for ($i = 1; $i <= $entity["tendency_steps"]; $i++) {
             //get the value either from post saves or preselected
             $tpl->set_var(array("CHECKED" => isset($post[$input_id . "_" . $value]) && $post[$input_id . "_" . $value] == $i || $post[$input_id][$value] == $i ? 'checked="checked"' : "", "INPUT_ID" => $input_id . "_" . $value, "VALUE" => $i));
             $tpl->parse("INPUT_TENDENCY_CELL", "input_tendency_cell", true);
         }
         $tpl->parse("INPUT_TENDENCY_ROW", "input_tendency_row", true);
     }
     $tpl->parse("INPUT_ELEMENT", "input_tendency");
     $tpl->parse("QUEST_CELL", "question_align_top", true);
     break;
示例#4
0
文件: add_forum.php 项目: rolwi/koala
    }
}
$steam->disconnect();
//******************************************************
//** Display Stuff
//******************************************************
$t = new Template("./templates/{$language}", "keep");
$t->set_file(array("add_forum" => "forum_add_forum.ihtml"));
$t->set_block("add_forum", "add", "DUMMY");
$t->set_block("add_forum", "no_access", "DUMMY");
$t->set_block("add_forum", "error", "DUMMY");
$t->set_block("add_forum", "error_title", "DUMMY");
$t->set_block("add_forum", "error_not_logged_in", "DUMMY");
$t->set_block("add_forum", "button_mission", "BUTTON_MISSION_ROW");
$t->set_block("add_forum", "button_label_save", "DUMMY");
$t->set_var(array("BUTTON_CANCEL_MISSION" => "close", "BUTTON_CANCEL_URL" => "", "BUTTON_MISSION_ROW" => "", "CURRENT_FORUM" => norm_post($attrib[OBJ_DESC]), "DUMMY" => "", "ERROR_TITLE" => "", "FORUM_ID" => $room_id, "ERROR_FEEDBACK" => "", "FORM_SUBTITLE" => norm_post($subtitle), "FORM_TITLE" => norm_post($title), "FORM_DESCRIPTION" => htmlentities($description), "BUTTON_URL" => "{$config_webserver_ip}/modules/forum/add_forum.php", "BUTTON_MISSION" => "save", "DO_LOGIN" => "0", "BODY_ON_LOAD" => "if (document.form_blueprint.title) document.form_blueprint.title.focus();"));
if ($do_login) {
    $t->set_var(array("DO_LOGIN" => "1", "BODY_ON_LOAD" => "document.getElementById('form_blueprint').submit();"));
}
/* 
 * Error handling
 */
if (isset($messageboard) && !$messageboard->get_id()) {
    $error[] = "error";
}
if (isset($_POST["title"]) && trim($_POST["title"]) == "") {
    $error[] = "error_title";
}
//if action has been done and error occured put out error feedback
if ($action != "" && isset($error) && count($error) > 0) {
    foreach ($error as $error_type) {
示例#5
0
include "appointment_sort.php";
$content = $portlet_content;
$appointment = isset($_GET["appointment"]) ? $_GET["appointment"] : (isset($_POST["appointment"]) ? $_POST["appointment"] : "");
//display stuff
$tpl = new Template("./templates/{$language}", "keep");
$tpl->set_file("content", "appointment_edit.ihtml");
$tpl->set_block("content", "feedback_headline_null", "DUMMY");
$tpl->set_block("content", "feedback_startdate_wrong", "DUMMY");
$tpl->set_block("content", "feedback_enddate_wrong", "DUMMY");
$tpl->set_block("content", "feedback_time_wrong", "DUMMY");
$tpl->set_var(array("DUMMY" => "", "PORTAL_ID" => $portal->get_id(), "PORTAL_NAME" => $portal_name, "PORTLET_NAME" => $portlet_name, "PORTLET_ID" => $portlet->get_id(), "FEEDBACK" => "", "BUTTON_CANCEL_MISSION" => "", "BUTTON_CANCEL_URL" => "{$config_webserver_ip}/modules/portal2/portlets/appointment/edit.php", "BUTTON_CANCEL_ACTION" => "javascript:form_submit('', '{$config_webserver_ip}/modules/portal2/portlets/appointment/edit.php'); return false;", "BUTTON_MISSION" => "save", "BUTTON_URL" => "{$config_webserver_ip}/modules/portal2/portlets/appointment/appointment_edit.php"));
//action
if ($action == "save") {
    $action = "save return(portlets/appointment/edit.php)";
    //build new content element
    $tmp = array("topic" => norm_post("topic"), "location" => norm_post("location"), "start_date" => array("day" => $_POST["start_day"], "month" => $_POST["start_month"], "year" => $_POST["start_year"]), "start_time" => array("hour" => $_POST["start_hour"], "minutes" => $_POST["start_minutes"]), "end_date" => array("day" => $_POST["end_day"], "month" => $_POST["end_month"], "year" => $_POST["end_year"]), "description" => norm_post("description"), "linkurl" => norm_post("linkurl"));
    //verify input
    if (trim($tmp["topic"]) == "") {
        $tpl->parse("FEEDBACK", "feedback_headline_null", 1);
        $action = "";
    }
    if (!ereg("([0-9]{4})", $_POST["start_year"]) || !ereg("([0-9]{1,2})", $_POST["start_month"]) || (int) $_POST["start_month"] < 1 || (int) $_POST["start_month"] > 12 || !ereg("([0-9]{1,2})", $_POST["start_day"]) || (int) $_POST["start_day"] < 1 || (int) $_POST["start_day"] > date("t", mktime(0, 0, 0, (int) $_POST["start_month"], 1, (int) $_POST["start_year"]))) {
        $tpl->parse("FEEDBACK", "feedback_startdate_wrong", 1);
        $action = "";
    }
    if ($_POST["end_day"] != "" && $_POST["end_month"] != "" && $_POST["end_year"] != "" && (!ereg("([0-9]{4})", $_POST["end_year"]) || !ereg("([0-9]{1,2})", $_POST["end_month"]) || (int) $_POST["end_month"] < 1 || (int) $_POST["end_month"] > 12 || !ereg("([0-9]{1,2})", $_POST["end_day"]) || (int) $_POST["end_day"] < 1 || (int) $_POST["end_day"] > date("t", mktime(0, 0, 0, (int) $_POST["end_month"], 1, (int) $_POST["end_year"])))) {
        $tpl->parse("FEEDBACK", "feedback_enddate_wrong", 1);
        $action = "";
    }
    if ($_POST["start_hour"] != "" && $_POST["start_minutes"] != "" && (!ereg("([0-9]{1,2})", $_POST["start_hour"]) || (int) $_POST["start_hour"] < 0 || (int) $_POST["start_hour"] > 23 || !ereg("([0-9]{1,2})", $_POST["start_minutes"]) || (int) $_POST["start_minutes"] < 0 || (int) $_POST["start_minutes"] > 59)) {
        $tpl->parse("FEEDBACK", "feedback_time_wrong", 1);
示例#6
0
                $errors[] = "error_sec_date_is_smaller";
            }
            if ($first_date + 86400 < time()) {
                $errors[] = "error_first_date_is_past";
            }
            if (count($errors) == 0) {
                $arr_edit_time = array(1, $first_date, $sec_date);
            } else {
                $arr_edit_time = array(0, 0, 0);
            }
        }
    } else {
        $arr_edit_time = array(0, 0, 0);
    }
    if (count($errors) == 0) {
        $attributes = array("bid:questionary:number" => isset($_POST["number"]), "bid:questionary:description" => norm_post($_POST["description"]), "bid:questionary:fillout" => $_POST["fillout"], "bid:questionary:editanswer" => $_POST["editanswer"], "bid:questionary:editownanswer" => $_POST["editownanswer"], "bid:questionary:edittime" => $arr_edit_time, "bid:questionary:enabled" => $arr_edit_time[0] == 1 ? false : $enabled, "bid:questionary:resultcreator" => $_POST["resultcreator"], "bid:questionary:resultcreationtime" => $_POST["resultcreationtime"]);
        $result = $questionary->set_attributes($attributes);
    }
}
//Disconnect
$steam->disconnect();
//redirect to edit page again
if (isset($result) && $result) {
    header("Location: {$config_webserver_ip}/modules/questionary/edit.php?questionary=" . $questionary->get_id());
    exit;
}
//******************************************************
//** Display Stuff
//******************************************************
//template stuff
$tpl = new Template("./templates/{$language}", "keep");
示例#7
0
  ****************************************************************************/
include "../../header.php";
$category = isset($_GET["category"]) ? $_GET["category"] : (isset($_POST["category"]) ? $_POST["category"] : "");
$content = $portlet_content;
//display stuff
$tpl = new Template("./templates/{$language}", "keep");
$tpl->set_file("content", "category_edit.ihtml");
$tpl->set_block("content", "feedback_headline_null", "DUMMY");
$tpl->set_var(array("DUMMY" => "", "PORTAL_ID" => $portal->get_id(), "PORTAL_NAME" => $portal_name, "PORTLET_NAME" => $portlet_name, "PORTLET_ID" => $portlet->get_id(), "FEEDBACK" => "", "BUTTON_CANCEL_MISSION" => "", "BUTTON_CANCEL_URL" => "{$config_webserver_ip}/modules/portal2/portlets/topic/edit.php", "BUTTON_MISSION" => "save", "BUTTON_URL" => "{$config_webserver_ip}/modules/portal2/portlets/topic/category_edit.php", "BUTTON_CANCEL_ACTION" => "javascript:form_submit('', '{$config_webserver_ip}/modules/portal2/portlets/topic/edit.php'); return false;"));
//save stuff
if ($action == "save") {
    $action = "save return(portlets/topic/edit.php)";
    if ($category == "") {
        $category = array_push($content, array("title" => norm_post("title"), "topics" => array())) - 1;
    } else {
        $content[$category]["title"] = norm_post("title");
    }
    //verify input
    if ($_POST["title"] == "") {
        $tpl->parse("FEEDBACK", "feedback_headline_null");
        $action = "";
    }
    $portlet_content = $content;
}
//if new category then leave all empty
if ($action == "new") {
    $tpl->set_var(array("CATEGORY_ID" => "", "CATEGORY_TITLE" => ""));
} else {
    $tpl->set_var(array("CATEGORY_ID" => $category, "CATEGORY_TITLE" => trim($content[$category]["title"])));
}
$tpl->pparse("OUT", "content");
示例#8
0
            echo "<html><body onload='javascript:opener.top.location.reload();window.close();'></body></html";
            $steam->disconnect();
            exit;
        }
    }
}
$steam->disconnect();
//******************************************************
//** Display Stuff
//******************************************************
$t = new Template("./templates/{$language}", "keep");
$t->set_file(array("edit_forum" => "forum_edit_forum.ihtml"));
$t->set_block("edit_forum", "add", "DUMMY");
$t->set_block("edit_forum", "no_access", "DUMMY");
$t->set_block("edit_forum", "error", "DUMMY");
$t->set_block("edit_forum", "error_title", "DUMMY");
$t->set_block("edit_forum", "button_mission", "BUTTON_MISSION_ROW");
$t->set_block("edit_forum", "button_label_save", "DUMMY");
$t->set_var(array("BUTTON_CANCEL_MISSION" => "close", "BUTTON_CANCEL_URL" => "", "BUTTON_MISSION_ROW" => "", "CURRENT_FORUM" => norm_post($attrib[OBJ_DESC]), "DUMMY" => "", "FORUM_ID" => $object->get_id(), "ERROR_FEEDBACK" => ""));
$subtitle = $attrib["bid:forum_subtitle"] ? $attrib["bid:forum_subtitle"] : "";
$title = isset($_POST['title']) ? $_POST["title"] : $attrib[OBJ_DESC];
$description = $attrib["bid:description"] ? $attrib["bid:description"] : "";
/*
//no access to write
elseif(isset($allowed_write) && !$allowed_write){
 $t->parse("ERROR_FEEDBACK", "no_access");
}


$t->pparse("OUT", "edit_forum");
*/
示例#9
0
文件: edit.php 项目: rolwi/koala
$tmpl = new Template("./templates/{$language}", "keep");
$tmpl->set_file("content", "edit.ihtml");
$tmpl->set_block("content", "feedback_poll_topic_null", "DUMMY");
$tmpl->set_block("content", "poll_row", "OPTION_ROWS");
$tmpl->set_var(array("DUMMY" => "", "PORTLET_ROOT" => $config_webserver_ip . "/modules/portal2/portlets/poll", "PORTAL_ID" => $portal->get_id(), "PORTAL_NAME" => $portal->get_attribute(OBJ_NAME), "BUTTON_MISSION" => "save", "BUTTON_URL" => "{$config_webserver_ip}/modules/portal2/portlets/poll/edit.php", "BUTTON_CANCEL_MISSION" => "", "BUTTON_CANCEL_URL" => "{$config_webserver_ip}/modules/portal2/portlet_edit.php", "BUTTON_CANCEL_ACTION" => "opener.top.location.reload();window.close();", "FEEDBACK" => ""));
//save action
if ($action == "save") {
    $action = "save return(portlet_edit.php)";
    $options = array();
    // the options the user may choose between
    $options_votecount = array();
    // how often each of the options has been chosen so far
    for ($i = 0; $i < 6; $i++) {
        $options[$i] = norm_post($_POST["option{$i}"]);
        $options_votecount[$i] = norm_post($_POST["option_votecount{$i}"]);
    }
    $poll_topic = trim($_POST["poll_topic"]);
    $content = array("poll_topic" => norm_post("{$poll_topic}"), "start_date" => array("day" => $_POST["start_day"], "month" => $_POST["start_month"], "year" => $_POST["start_year"]), "end_date" => array("day" => $_POST["end_day"], "month" => $_POST["end_month"], "year" => $_POST["end_year"]), "options" => $options, "options_votecount" => $options_votecount);
    //verify input
    if (trim($content["poll_topic"]) == "") {
        $tmpl->parse("FEEDBACK", "feedback_poll_topic_null", 1);
        $action = "";
    }
    $portlet_content = $content;
    $groupEveryone = steam_factory::groupname_to_object($steam, "everyone");
    $portlet->sanction(SANCTION_WRITE, $groupEveryone);
}
//display stuff
$tmpl->set_var(array("PORTAL_NAME" => $portal_name, "PORTLET_NAME" => $portlet_title, "OBJECT_ID" => $portlet->get_id(), "TITLE" => $portlet_title, "START_DAY" => isset($content["start_date"]) ? norm_post($content["start_date"]["day"]) : "", "START_MONTH" => isset($content["start_date"]) ? norm_post($content["start_date"]["month"]) : "", "START_YEAR" => isset($content["start_date"]) ? norm_post($content["start_date"]["year"]) : "", "END_DAY" => isset($content["end_date"]) ? norm_post($content["end_date"]["day"]) : "", "END_MONTH" => isset($content["end_date"]) ? norm_post($content["end_date"]["month"]) : "", "END_YEAR" => isset($content["end_date"]) ? norm_post($content["end_date"]["year"]) : "", "POLL_TOPIC" => isset($content["poll_topic"]) ? norm_post($content["poll_topic"]) : "", "OPTION0" => isset($content["options"][0]) ? norm_post($content["options"][0]) : "", "OPTION1" => isset($content["options"][1]) ? norm_post($content["options"][1]) : "", "OPTION2" => isset($content["options"][2]) ? norm_post($content["options"][2]) : "", "OPTION3" => isset($content["options"][3]) ? norm_post($content["options"][3]) : "", "OPTION4" => isset($content["options"][4]) ? norm_post($content["options"][4]) : "", "OPTION5" => isset($content["options"][5]) ? norm_post($content["options"][5]) : "", "OPTION_VOTECOUNT0" => isset($content["options_votecount"][0]) ? norm_post($content["options_votecount"][0]) : 0, "OPTION_VOTECOUNT1" => isset($content["options_votecount"][1]) ? norm_post($content["options_votecount"][1]) : 0, "OPTION_VOTECOUNT2" => isset($content["options_votecount"][2]) ? norm_post($content["options_votecount"][2]) : 0, "OPTION_VOTECOUNT3" => isset($content["options_votecount"][3]) ? norm_post($content["options_votecount"][3]) : 0, "OPTION_VOTECOUNT4" => isset($content["options_votecount"][4]) ? norm_post($content["options_votecount"][4]) : 0, "OPTION_VOTECOUNT5" => isset($content["options_votecount"][5]) ? norm_post($content["options_votecount"][5]) : 0));
$tmpl->pparse("OUT", "content");
include "../../footer.php";
示例#10
0
文件: edit.php 项目: rolwi/koala
  See the GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program; if not, write to the Free Software Foundation,
  Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

  Author: Henrik Beige <*****@*****.**>
          Bastian Schröder <*****@*****.**>

  ****************************************************************************/
include "../../header.php";
$content = $portlet_content;
$tmpl = new Template("./templates/{$language}", "keep");
$tmpl->set_file("content", "edit.ihtml");
$tmpl->set_block("content", "feedback_headline_null", "DUMMY");
$tmpl->set_var(array("DUMMY" => "", "PORTAL_ID" => $portal->get_id(), "PORTAL_NAME" => $portal->get_attribute(OBJ_NAME), "BUTTON_MISSION" => "save", "BUTTON_URL" => "{$config_webserver_ip}/modules/portal2/portlets/headline/edit.php", "BUTTON_CANCEL_MISSION" => "", "BUTTON_CANCEL_URL" => "{$config_webserver_ip}/modules/portal2/portlet_edit.php", "BUTTON_CANCEL_ACTION" => "opener.top.location.reload();window.close();", "FEEDBACK" => ""));
//save action
if ($action == "save") {
    $action = "save return(portlet_edit.php)";
    $content = array("headline" => norm_post("headline"), "alignment" => norm_post("alignment"), "size" => norm_post("size"));
    //verify input
    if (trim($content["headline"]) == "") {
        $tmpl->parse("FEEDBACK", "feedback_headline_null", 1);
        $action = "";
    }
    $portlet_content = $content;
}
//display stuff
$tmpl->set_var(array("PORTAL_NAME" => $portal_name, "PORTLET_NAME" => $portlet_title, "OBJECT_ID" => $portlet->get_id(), "TITLE" => $portlet_title, "HEADLINE" => isset($content["headline"]) ? norm_post($content["headline"]) : "", "SELECTED_LEFT" => isset($content["alignment"]) && trim($content["alignment"]) == "left" ? "SELECTED" : "", "SELECTED_CENTER" => isset($content["alignment"]) && trim($content["alignment"]) == "center" ? "SELECTED" : "", "SELECTED_RIGHT" => isset($content["alignment"]) && trim($content["alignment"]) == "right" ? "SELECTED" : "", "SELECTED_15" => isset($content["size"]) && trim($content["size"]) == 15 ? "SELECTED" : "", "SELECTED_20" => isset($content["size"]) && trim($content["size"]) == 20 ? "SELECTED" : "", "SELECTED_25" => isset($content["size"]) && trim($content["size"]) == 25 ? "SELECTED" : "", "SELECTED_30" => isset($content["size"]) && trim($content["size"]) == 30 ? "SELECTED" : "", "SELECTED_35" => isset($content["size"]) && trim($content["size"]) == 35 ? "SELECTED" : "", "SELECTED_40" => isset($content["size"]) && trim($content["size"]) == 40 ? "SELECTED" : "", "SELECTED_50" => isset($content["size"]) && trim($content["size"]) == 50 ? "SELECTED" : "", "SELECTED_60" => isset($content["size"]) && trim($content["size"]) == 60 ? "SELECTED" : ""));
$tmpl->pparse("OUT", "content");
include "../../footer.php";
示例#11
0
文件: new.php 项目: rolwi/koala
$access_read = $current_room->check_access_read($steam->get_login_user());
$access_insert = $current_room->check_access_insert($steam->get_login_user());
$allowed = $access_write && $access_read && $access_insert ? true : false;
if (!$allowed) {
    //Disconnect & close
    $steam->disconnect();
    die("<html>\n<body onload='javascript:window.close();'>\n</body>\n</html>");
}
//create questionary if adviced too
if (isset($_POST["mission"]) && $_POST["mission"] == "create" && $name != "" && $allowed) {
    //create new questionary
    $questionary = steam_factory::create_container($steam, $name, $current_room);
    $questions_folder = steam_factory::create_container($steam, 'questions', $questionary);
    $answers_folder = steam_factory::create_container($steam, 'answers', $questionary);
    if (isset($_POST["description"])) {
        $description = norm_post($_POST["description"]);
    } else {
        $description = "";
    }
    if ($questionary && $questions_folder && $answers_folder) {
        //set standard layout
        $layout = $templates[1];
        unset($layout["name_ge"]);
        unset($layout["name_en"]);
        //define rights for the attributes
        $loginuser_id = $steam->get_login_user()->get_id();
        $rootid = steam_factory::username_to_object($steam, "root")->get_id();
        $author_rights[$loginuser_id] = $loginuser_id;
        $editor_rights[$loginuser_id] = $loginuser_id;
        $analyst_rights[$loginuser_id] = $loginuser_id;
        $author_rights[$rootid] = $rootid;
示例#12
0
    }
    if ($_POST["rows"] <= 0) {
        $errors[] = "error_bigger_zero_rows";
    }
    //update according description
    if (!isset($errors)) {
        if ($action == "insert") {
            //create new element in question folder
            $question = steam_factory::create_container($steam, time() . "", $question_folder);
            $question_id = $question->get_id();
        }
        $geo = new questionary_geo();
        if ($_POST["rows"] > 1) {
            $geo->add_input_textarea(norm_post("question"), $_POST["question_position"], norm_post("width") == " " ? 400 : norm_post("width"), norm_post("rows"), norm_post("value"), isset($_POST["must"]), isset($_POST["output"]));
        } else {
            $geo->add_input_text(norm_post("question"), $_POST["question_position"], norm_post("width") == " " ? 400 : norm_post("width"), norm_post("maxlength"), norm_post("value"), isset($_POST["must"]), isset($_POST["output"]));
        }
        //save geometry in question
        $result = $question->set_attribute("bid:question:geometry", $geo->get_last_element());
    }
}
//Disconnect
$steam->disconnect();
//redirect to edit page again
if (isset($result) && $result) {
    header("Location: {$config_webserver_ip}/modules/questionary/edit.php?questionary=" . $questionary->get_id());
    exit;
}
//******************************************************
//** Display Stuff
//******************************************************
示例#13
0
文件: index.php 项目: rolwi/koala
$t->set_block("view_forum", "no_access", "DUMMY");
$t->set_block("view_forum", "add_category_button", "DUMMY");
$t->set_block("view_forum", "paste_category_button", "DUMMY");
$t->set_block("view_forum", "edit_forum_button", "DUMMY");
$t->set_block("view_forum", "subscribe_forum_button", "DUMMY");
$t->set_block("view_forum", "unsubscribe_forum_button", "DUMMY");
$t->set_block("view_forum", "new_message_info", "DUMMY");
$forum_subtitle = $forumAttributes["bid:forum_subtitle"] ? $forumAttributes["bid:forum_subtitle"] : "";
$t->set_var(array("ACTION_LINKS" => "", "DUMMY" => "", "ADD_CATEGORY_BUTTON" => "", "PASTE_CATEGORY_BUTTON" => "", "EDIT_FORUM_BUTTON" => "", "SUBSCRIBE_FORUM_BUTTON" => "", "FORUM_CREATION_TIME" => date("d.m.Y", $forumAttributes["OBJ_CREATION_TIME"]), "FORUM_DESC" => $forumAttributes["bid:description"], "FORUM_ENVIRONMENT_ID" => $forumEnvironment->get_id(), "FORUM_ENVIRONMENT_NAME" => norm_post($forumEnvironmentAttributes[OBJ_DESC]), "FORUM_NAME" => norm_post($forumAttributes[OBJ_DESC]), "FORUM_OBJECT" => $forum->get_id(), "FORUM_OWNER" => $forumCreatorAttributes[OBJ_NAME], "FORUM_SUBTITLE" => norm_post($forum_subtitle), "ITEM" => "", "NEW_MESSAGE_INFO" => ""));
//no categories in forum
if (empty($categories)) {
    $t->parse("ITEM", "no_entries");
} else {
    foreach ($categories as $category) {
        $id = $category->get_id();
        $t->set_var(array("CATEGORIE_COUNT_MESSAGES" => $categoryMessageCount[$id] + 1, "CATEGORIE_DESCRIPTION" => norm_post($categoryAttributes[$id]["bid:description"]), "CATEGORIE_LAST_POST_TIME" => "", "CATEGORIE_NAME" => norm_post($categoryAttributes[$id][OBJ_DESC]), "CATEGORIE_OBJECT" => $id, "CATEGORIE_OWNER" => $categoryCreator[$id]->get_name()));
        if ($categoryMessageCount[$id] > 0) {
            $t->set_var(array("CATEGORIE_LAST_POST_MESSAGE" => $categoryLastMessageAttributes[$id][OBJ_DESC], "CATEGORIE_LAST_POST_TIME" => date("d.m.Y G:i", $categoryLastMessageAttributes[$id][OBJ_CREATION_TIME]), "CATEGORIE_LAST_POSTER" => $categoryLastMessageCreator[$id]->get_name(), "CATEGORIE_LAST_POST_ID" => end($messages[$id])->get_id()));
            $t->parse("CATEGORIE_LAST_POST", "last_post", true);
            // required for notification icon
            $lastPostTime = intval($categoryLastMessageAttributes[$id][OBJ_CREATION_TIME]);
        } else {
            // required for notification icon
            $lastPostTime = intval($categoryAttributes[$id][OBJ_CREATION_TIME]);
        }
        /* 
         * Display a notification icon, if new contributions
         * to a thread are available, which have been added
         * after the last user login.
         */
        $lastSessionTime = $steamUserAttributes["bid:last_session_time"];
示例#14
0
$t->set_block("view_category", "categorie_action_edit", "DUMMY");
$t->set_block("view_category", "categorie_action_delete", "DUMMY");
//$t->set_block("view_category", "creator_icon", "DUMMY");
$t->set_block("view_category", "message", "DUMMY");
$t->set_block("view_category", "no_access", "DUMMY");
$t->set_block("view_category", "edit_message_annotation", "DUMMY");
$t->set_block("view_category", "delete_message_annotation", "DUMMY");
$forum_subtitle = $forumAttributes["bid:forum_subtitle"] ? $forumAttributes["bid:forum_subtitle"] : "";
$t->set_var(array("ADD_MESSAGE" => "", "ACTION_DELETE" => "", "ACTION_EDIT" => "", "CATEGORIE_ACTION_EDIT" => "", "CATEGORIE_ACTION_DELETE" => "", "DUMMY" => "", "FORUM_NAME" => norm_post($forumAttributes["OBJ_DESC"]), "FORUM_ID" => $forum->get_id(), "FORUM_ENVIRONMENT_ID" => $forum->forum_environment->id, "FORUM_ENVIRONMENT_NAME" => norm_post($forum->forum_environment_name), "FORUM_SUBTITLE" => norm_post($forum_subtitle), "FORUM_OWNER" => $forumCreatorAttributes[OBJ_NAME], "ITEM" => ""));
//show details and messages of a category
if (isset($category) && !empty($category)) {
    $t->set_var(array("CATEGORIE_DESCRIPTION" => $categoryAttributes["bid:description"], "CATEGORIE_CONTENT" => $categoryContent, "CATEGORIE_CREATOR" => $categoryCreatorAttributes[OBJ_NAME], "CATEGORIE_CREATION_TIME" => date("j.m.Y G:i", $categoryAttributes['OBJ_CREATION_TIME']), "CATEGORIE_NAME" => norm_post($categoryAttributes[OBJ_DESC]), "CATEGORIE_OBJECT" => $category->get_id()));
    if (is_array($messages) && isset($messages)) {
        foreach ($messages as $message) {
            $id = $message->get_id();
            $t->set_var(array("MESSAGE_CONTENT" => $messageContent[$id], "MESSAGE_CREATOR" => $messageCreator[$id]->get_name(), "MESSAGE_CREATION_TIME" => date("j.m.Y G:i", $messageAttributes[$id][OBJ_CREATION_TIME]), "MESSAGE_ID" => $id, "MESSAGE_NAME" => norm_post($messageAttributes[$id][OBJ_DESC]), "AUTHOR" => $messageAttributes[$id]["DOC_USER_MODIFIED"]->get_name(), "TIMESTAMP" => date("j.m.Y G:i", $messageAttributes[$id]["DOC_LAST_MODIFIED"])));
            //if($categorie_entries[$item]['OBJ_CREATOR'][2]["OBJ_ICON"]->id != 0 ){
            //$t->parse("MESSAGE_CREATOR_ICON", "creator_icon");
            //}
            //add action_links
            if ($messageAccessWrite[$id]) {
                //delete message if login-user is forum-creator
                if ($steamUser->get_id() == $forumCreator->get_id()) {
                    $t->parse("ACTION_DELETE", "action_delete");
                }
                //edit message if login-user is forum-creator or message-creator
                if ($steamUser->get_id() == $forumCreator->get_id() || $steamUser->get_id() == $messageCreator[$id]->get_id()) {
                    $t->parse("ACTION_EDIT", "action_edit");
                }
            }
            //add message link if allowed
示例#15
0
文件: edit.php 项目: rolwi/koala
  See the GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program; if not, write to the Free Software Foundation,
  Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

  Author: Harald Selke
  EMail: hase@uni-paderborn.de

  ****************************************************************************/
include "../../header.php";
$content = $portlet_content;
$tmpl = new Template("./templates/{$language}", "keep");
$tmpl->set_file("content", "edit.ihtml");
$tmpl->set_block("content", "feedback_url_null", "DUMMY");
$tmpl->set_var(array("DUMMY" => "", "PORTAL_ID" => $portal->get_id(), "PORTAL_NAME" => $portal->get_attribute(OBJ_NAME), "BUTTON_MISSION" => "save", "BUTTON_URL" => "{$config_webserver_ip}/modules/portal2/portlets/media/edit.php", "BUTTON_CANCEL_MISSION" => "", "BUTTON_CANCEL_URL" => "{$config_webserver_ip}/modules/portal2/portlet_edit.php", "FEEDBACK" => ""));
//save action
if ($action == "save") {
    $action = "save return(portlet_edit.php)";
    $content = array("headline" => norm_post("headline"), "url" => norm_post("url"), "media_type" => norm_post("media_type"), "description" => norm_post("description"));
    //verify input
    if (trim($content["url"]) == "") {
        $tmpl->parse("FEEDBACK", "url", 1);
        $action = "";
    }
    $portlet_content = $content;
}
//display stuff
$tmpl->set_var(array("PORTAL_NAME" => $portal_name, "PORTLET_NAME" => $portlet_name, "OBJECT_ID" => $portlet->get_id(), "TITLE" => $portlet_name, "HEADLINE" => isset($content["headline"]) ? norm_post($content["headline"]) : "", "URL" => isset($content["url"]) ? norm_post($content["url"]) : "", "MEDIA_TYPE" => isset($content["media_type"]) ? norm_post($content["media_type"]) : "", "DESCRIPTION" => isset($content["description"]) ? norm_post($content["description"]) : "", "SELECTED_IMAGE" => isset($content["media_type"]) && trim($content["media_type"]) == "image" ? "SELECTED" : "", "SELECTED_MOVIE" => isset($content["media_type"]) && trim($content["media_type"]) == "movie" ? "SELECTED" : "", "SELECTED_AUDIO" => isset($content["media_type"]) && trim($content["media_type"]) == "audio" ? "SELECTED" : ""));
$tmpl->pparse("OUT", "content");
include "../../footer.php";
示例#16
0
$content = isset($_POST['content']) ? $_POST['content'] : $object_content;
$title = isset($_POST['title']) ? $_POST["title"] : $attrib[OBJ_DESC];
//******************************************************
//** Display Stuff
//******************************************************
$t = new Template("./templates/{$language}", "keep");
$t->set_file(array("edit_message" => "forum_edit_message.ihtml"));
$t->set_block("edit_message", "add", "DUMMY");
$t->set_block("edit_message", "no_access", "DUMMY");
$t->set_block("edit_message", "error", "DUMMY");
$t->set_block("edit_message", "error_content", "DUMMY");
$t->set_block("edit_message", "error_title", "DUMMY");
$t->set_block("edit_message", "error_not_logged_in", "DUMMY");
$t->set_block("edit_message", "button_mission", "BUTTON_MISSION_ROW");
$t->set_block("edit_message", "button_label_save", "DUMMY");
$t->set_var(array("CURRENT_FORUM" => $category_attributes[OBJ_DESC], "OBJECT_ID" => $object_id, "DUMMY" => "", "ERROR_FEEDBACK" => "", "BUTTON_CANCEL_MISSION" => "close", "BUTTON_CANCEL_URL" => "", "BUTTON_MISSION_ROW" => "", "FORM_CONTENT" => htmlentities($content), "FORM_TITLE" => norm_post($title), "BUTTON_URL" => "{$config_webserver_ip}/modules/forum/edit_message.php", "BUTTON_MISSION" => "save", "DO_LOGIN" => "0", "BODY_ON_LOAD" => "if (document.form_blueprint.title) document.form_blueprint.title.focus();"));
if ($do_login) {
    $t->set_var(array("DO_LOGIN" => "1", "BODY_ON_LOAD" => "document.getElementById('form_blueprint').submit();"));
}
/* 
 * Error handling
 */
//if action has been done and error occured put out error feedback
if ($action != "" && isset($error) && count($error) > 0) {
    foreach ($error as $error_type) {
        $t->parse("ERROR_FEEDBACK", $error_type, true);
    }
}
$t->parse("BUTTON_LABEL", "button_label_save");
$t->parse("BUTTON_MISSION_ROW", "button_mission", true);
$t->pparse("OUT", "edit_message");
示例#17
0
文件: edit.php 项目: rolwi/koala
  See the GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program; if not, write to the Free Software Foundation,
  Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

  Author: Henrik Beige <*****@*****.**>
          Bastian Schröder <*****@*****.**>

  ****************************************************************************/
include "../../header.php";
$content = $portlet_content;
$tmpl = new Template("./templates/{$language}", "keep");
$tmpl->set_file("content", "edit.ihtml");
$tmpl->set_block("content", "feedback_address_null", "DUMMY");
$tmpl->set_var(array("DUMMY" => "", "PORTAL_ID" => $portal->get_id(), "PORTAL_NAME" => $portal_name, "BUTTON_MISSION" => "save", "BUTTON_URL" => "{$config_webserver_ip}/modules/portal2/portlets/rss/edit.php", "BUTTON_CANCEL_ACTION" => "opener.top.location.reload();window.close();", "BUTTON_CANCEL_MISSION" => "", "BUTTON_CANCEL_URL" => "{$config_webserver_ip}/modules/portal2/portlet_edit.php", "FEEDBACK" => ""));
//save action
if ($action == "save") {
    $action = "save return(portlet_edit.php)";
    $content = array("address" => trim(norm_post("address")), "num_items" => trim(norm_post("num_items")), "desc_length" => trim(norm_post("desc_length")), "style" => norm_post("style"), "allow_html" => isset($_POST["allow_html"]) ? "checked" : "");
    //verify input
    if ($content["address"] == "") {
        $tmpl->parse("FEEDBACK", "feedback_address_null", 1);
        $action = "";
    }
    $portlet_content = $content;
}
//display stuff
$tmpl->set_var(array("PORTAL_NAME" => $portal_name, "PORTLET_NAME" => $portlet_name, "OBJECT_ID" => $portlet->get_id(), "TITLE" => $portlet_name, "ADDRESS" => isset($content["address"]) ? $content["address"] : "", "NUM_ITEMS" => isset($content["num_items"]) ? $content["num_items"] : "", "DESC_LENGTH" => isset($content["desc_length"]) ? $content["desc_length"] : "", "SELECTED_STYLE_RSS_FEED" => isset($content["style"]) && trim($content["style"]) == "rss_feed" ? "SELECTED" : "", "SELECTED_STYLE_MESSAGE" => isset($content["style"]) && trim($content["style"]) == "message" ? "SELECTED" : "", "ALLOW_HTML" => trim($content["allow_html"])));
$tmpl->pparse("OUT", "content");
include "../../footer.php";