public function output($action = "", $view = "public") { global $title_input_size; // Public vs. Private parent::establishView($view); if ($action == "edit") { if ($this->_pluslet_id) { $this->_pluslet_id_field = "pluslet-" . $this->_pluslet_id; $this->_pluslet_name_field = ""; $this->_title = "<input type=\"text\" class=\"required_field\" id=\"pluslet-update-title-{$this->_pluslet_id}\" value=\"{$this->_title}\" size=\"{$title_input_size}\" />"; } else { $new_id = rand(10000, 100000); $this->_pluslet_bonus_classes = "unsortable"; $this->_pluslet_id_field = $new_id; $this->_pluslet_name_field = "new-pluslet-Heading"; $this->_title = "<input type=\"text\" class=\"required_field\" id=\"pluslet-new-title-{$new_id}\" name=\"new_pluslet_title\" value=\"{$this->_title}\" size=\"{$title_input_size}\" />"; } global $title_input_size; // alter size based on column parent::startPluslet(); print $this->_body; parent::finishPluslet(); return; } else { parent::assemblePluslet(); return $this->_pluslet; } }
public function output($action = "", $view) { global $CKPath; global $CKBasePath; parent::establishView($view); if ($action == "edit") { // make an editable body and title type global $title_input_size; // alter size based on column // ////////////////////// // New or Existing? ////////////////////// if ($this->_pluslet_id) { $this->_pluslet_id_field = "pluslet-" . $this->_pluslet_id; $this->_pluslet_bonus_classes = "basic-pluslet"; $this->_pluslet_name_field = ""; $clean_title = addslashes(htmlentities($this->_title)); $this->_title = "<input type=\"text\" class=\"edit-input\" id=\"pluslet-update-title-{$this->_pluslet_id}\" value=\"{$clean_title}\" size=\"{$title_input_size}\" />"; $this_instance = "pluslet-update-body-{$this->_pluslet_id}"; } else { $new_id = rand(10000, 100000); $this->_pluslet_bonus_classes = "unsortable basic-pluslet"; $this->_pluslet_id_field = $new_id; $this->_pluslet_name_field = "new-pluslet-Basic"; $this->_title = "<input type=\"text\" class=\"edit-input\" id=\"pluslet-new-title-{$new_id}\" name=\"new_pluslet_title\" value=\"{$this->_title}\" size=\"{$title_input_size}\" />"; $this_instance = "pluslet-new-body-{$new_id}"; } include $CKPath; global $BaseURL; $oCKeditor = new CKEditor($CKBasePath); $oCKeditor->timestamp = time(); //$oCKeditor->config['ToolbarStartExpanded'] = true; $config['toolbar'] = 'SubsPlus_Narrow'; $config['height'] = '300'; $config['filebrowserUploadUrl'] = $BaseURL . "ckeditor/php/uploader.php"; // Create and output object print parent::startPluslet(); $this->_body = $oCKeditor->editor($this_instance, $this->_body, $config); print parent::finishPluslet(); return; } else { // notitle hack if (!isset($this->_hide_titlebar)) { if (trim($this->_title) == "notitle") { $this->_hide_titlebar = 1; } else { $this->_hide_titlebar = 0; } } // Look for tokens, tokenize parent::tokenizeText(); parent::assemblePluslet($this->_hide_titlebar); return $this->_pluslet; } }
public function output($action = "", $view = "public") { global $title_input_size; // alter size based on column // Get pluslets associated with this $querier = new Querier(); $qs = "SELECT p.pluslet_id AS id, p.title, p.body, ps.pcolumn, p.type, p.extra,t.tab_index AS parent_id, t.label AS name\n\t\t\tFROM pluslet p INNER JOIN pluslet_section ps\n\t\t\tON p.pluslet_id = ps.pluslet_id\n\t\t\tINNER JOIN section sec\n\t\t\tON ps.section_id = sec.section_id\n\t\t\tINNER JOIN tab t\n\t\t\tON sec.tab_id = t.tab_id\n\t\t\tINNER JOIN subject s\n\t\t\tON t.subject_id = s.subject_id\n\t\t\tWHERE s.subject_id = '{$this->_subject_id}'\n\t\t\tAND p.type != 'TOC'\n\t\t\tORDER BY t.tab_index, ps.pcolumn, ps.prow ASC"; //print $qs; $this->_tocArray = $querier->query($qs); // public vs. admin parent::establishView($view); if ($this->_extra != "") { $jobj = json_decode($this->_extra); $this->_ticked_items = explode(',', $jobj->{'ticked'}); } if ($action == "edit") { ////////////////////// // New or Existing? ////////////////////// if ($this->_pluslet_id) { $this->_current_id = $this->_pluslet_id; $this->_pluslet_bonus_classes = "type-toc "; $this->_pluslet_id_field = "pluslet-" . $this->_pluslet_id; $this->_pluslet_name_field = ""; $this->_title = "<input type=\"text\" class=\"\" id=\"pluslet-update-title-{$this->_current_id}\" value=\"{$this->_title}\" size=\"{$title_input_size}\" />"; $this_instance = "pluslet-update-body-{$this->_pluslet_id}"; } else { $new_id = rand(10000, 100000); $this->_current_id = $new_id; $this->_pluslet_bonus_classes = "type-toc unsortable no_overflow"; $this->_pluslet_id_field = $new_id; $this->_pluslet_name_field = "new-pluslet-TOC"; $this->_title = "<input type=\"text\" class=\"\" id=\"pluslet-new-title-{$new_id}\" name=\"new_pluslet_title\" value=\"" . "Table of Contents" . "\" size=\"{$title_input_size}\" />"; $this_instance = "pluslet-new-body-{$new_id}"; } self::generateTOC($action); parent::startPluslet(); print $this->_body; parent::finishPluslet(); return; } else { // Note we hide the Feed parameters in the name field self::generateTOC($action); // notitle hack if (!isset($this->_hide_titlebar)) { if (trim($this->_title) == "notitle") { $this->_hide_titlebar = 1; } else { $this->_hide_titlebar = 0; } } parent::assemblePluslet($this->_hide_titlebar); return $this->_pluslet; } }
public function output($action = "", $view = "public") { // public vs. admin parent::establishView($view); if ($this->_extra != "") { $jobj = json_decode($this->_extra); $feed_type = $jobj->{'feed_type'}; $num_items = $jobj->{'num_items'}; $show_desc = $jobj->{'show_desc'}; $show_feed = $jobj->{'show_feed'}; if ($num_items == "") { $num_items = 5; } // need to pass something along } else { $feed_type = ""; $num_items = 5; $show_desc = ""; $show_feed = ""; } if ($action == "edit") { global $title_input_size; // alter size based on column ////////////////////// // New or Existing? ////////////////////// if ($this->_pluslet_id) { $current_id = $this->_pluslet_id; $this->_pluslet_id_field = "pluslet-" . $this->_pluslet_id; $this->_pluslet_name_field = ""; $this->_title = "<input type=\"text\" class=\"\" id=\"pluslet-update-title-{$this->_pluslet_id}\" value=\"{$this->_title}\" size=\"{$title_input_size}\" />"; $this_instance = "pluslet-update-body-{$this->_pluslet_id}"; } else { $new_id = rand(10000, 100000); $current_id = $new_id; $this->_pluslet_bonus_classes = "unsortable"; $this->_pluslet_id_field = $new_id; $this->_pluslet_name_field = "new-pluslet-Feed"; $this->_title = "<input type=\"text\" class=\"\" id=\"pluslet-new-title-{$new_id}\" name=\"new_pluslet_title\" value=\"{$this->_title}\" size=\"{$title_input_size}\" />"; $this_instance = "pluslet-new-body-{$new_id}"; } // some translations . . . $vYes = _("Yes"); $vNo = _("No"); $vRss1 = _("Display"); $vRss2 = _("items<br />Show descriptions?"); // Generate our dropdown $dd_name = "feed_type-{$current_id}"; $dd_array = array("RSS", "Delicious", "Tumblr"); $typeMe = new Dropdown($dd_name, $dd_array, $feed_type); $feed_type_dd = $typeMe->display(); $this->_body = "<br /><input type=\"text\" name=\"{$this_instance}\" class=\"required_field\" value=\"{$this->_body}\" size=\"{$title_input_size}\" />\n {$feed_type_dd}\n <br />\n " . _("You can enter a URL to an RSS feed or use your username for Delicious or Tumblr."); $this->_body .= "\n\n <p style=\"font-size: 11px;padding-top: 3px;\">\n {$vRss1} <input type=\"text\" name=\"displaynum-{$current_id}\" value=\"{$num_items}\" size=\"1\" />\n {$vRss2} <input name=\"showdesc-{$current_id}\" type=\"radio\" value=\"1\""; if ($show_desc == 1) { $this->_body .= " checked=\"checked\""; } $this->_body .= "> {$vYes} <input name=\"showdesc-{$current_id}\" type=\"radio\" value=\"0\" "; if ($show_desc == 0) { $this->_body .= " checked=\"checked\""; } $this->_body .= " /> {$vNo}<br />\n Show feed source? <input name=\"showfeed-{$current_id}\" type=\"radio\" value=\"1\""; if ($show_feed == 1) { $this->_body .= " checked=\"checked\""; } $this->_body .= "> {$vYes} <input name=\"showfeed-{$current_id}\" type=\"radio\" value=\"0\" "; if ($show_feed == 0) { $this->_body .= " checked=\"checked\""; } $this->_body .= " /> {$vNo}</p>\n<div>\n"; parent::startPluslet(); print $this->_body; parent::finishPluslet(); return; } else { // Note we hide the Feed parameters in the name field $vRSSLoading = _("Loading ..."); $feed = trim($this->_body); $this->_body = "<p class=\"find_feed\" name=\"{$feed}|{$num_items}|{$show_desc}|{$show_feed}|{$feed_type}\">{$vRSSLoading}</p>"; // notitle hack if (!isset($this->_hide_titlebar)) { if (trim($this->_title) == "notitle") { $this->_hide_titlebar = 1; } else { $this->_hide_titlebar = 0; } } parent::assemblePluslet($this->_hide_titlebar); return $this->_pluslet; } }