Exemplo n.º 1
0
 /**
  * Retreives the admin interface of this object. Anything that overrides
  * this method should call the parent method with it's output at the END of
  * processing.
  * @param string $subclass_admin_interface HTML content of the interface
  * element of a children.
  * @param string $type_interface SIMPLE pour éditer un seul champ, COMPLETE
  *                               pour voir toutes les chaînes, LARGE pour
  *                               avoir un textarea.
  * @return string The HTML fragment for this interface.
  */
 public function getAdminUI($subclass_admin_interface = null, $title = null, $type_interface = "LARGE")
 {
     // Init values.
     $html = '';
     $html .= $subclass_admin_interface;
     if (!empty($this->allowed_html_tags)) {
         $html .= "<div class='admin_section_hint'>" . _("This content type will display a list of online users at the current hotspot.") . "</div>";
     }
     return Content::getAdminUI($html, $title);
 }
Exemplo n.º 2
0
 /**
  * Retreives the admin interface of this object. Anything that overrides
  * this method should call the parent method with it's output at the END of
  * processing.
  * @param string $subclass_admin_interface HTML content of the interface
  * element of a children.
  * @param string $type_interface SIMPLE pour éditer un seul champ, COMPLETE
  *                               pour voir toutes les chaînes, LARGE pour
  *                               avoir un textarea.
  * @return string The HTML fragment for this interface.
  */
 public function getAdminUI($subclass_admin_interface = null, $title = null, $type_interface = "LARGE")
 {
     // Init values.
     $html = '';
     $html .= $subclass_admin_interface;
     if (!empty($this->allowed_html_tags)) {
         $html .= "<div class='admin_section_hint'>" . _("This content type will display a a graph of the user's remaining bandwidth according to dyabuse control rules.") . "</div>";
     }
     return Content::getAdminUI($html, $title);
 }
Exemplo n.º 3
0
 /**
  * Retreives the admin interface of this object. Anything that overrides
  * this method should call the parent method with it's output at the END of
  * processing.
  * @param string $subclass_admin_interface HTML content of the interface
  * element of a children.
  * @param string $type_interface SIMPLE pour éditer un seul champ, COMPLETE
  *                               pour voir toutes les chaînes, LARGE pour
  *                               avoir un textarea.
  * @return string The HTML fragment for this interface.
  */
 public function getAdminUI($subclass_admin_interface = null, $title = null, $type_interface = "LARGE")
 {
     // Init values.
     $html = '';
     $html .= $subclass_admin_interface;
     $result = "";
     //$variantsCounter = 0;
     //$_hideNewContent = false;
     if (!empty($this->allowed_html_tags)) {
         $html .= "<div class='admin_section_hint'>" . _("Only these HTML tags are allowed : ") . htmlentities($this->allowed_html_tags) . "</div>";
     }
     $html .= "<ul class='admin_element_list'>\n";
     $sql = "SELECT * FROM content_langstring_entries WHERE content_langstring_entries.langstrings_id = '{$this->id}' ORDER BY locales_id";
     $this->mBd->execSql($sql, $result, false);
     //echo "type_interface: $type_interface\n";
     $exclude_array = array();
     if ($result != null) {
         while (list($key, $value) = each($result)) {
             $exclude_array[$value['locales_id']] = $value['locales_id'];
             //                The next lines are a preview of a new suggested input mode
             //                ==========================================================
             //
             //                // Increase variants counter
             //                $variantsCounter++;
             //
             //                // Hide new content input
             //                $_hideNewContent = true;
             //
             //                $html .= "<li class='admin_element_item_container'>\n";
             //                $html .= "<div class='admin_element_data'>\n";
             //
             //                if ($type_interface == 'LARGE') {
             //                    $html .= "<textarea name='langstrings_".$this->id."_substring_$value[langstring_entries_id]_string' cols='60' rows='3'>".htmlspecialchars($value['value'], ENT_QUOTES, 'UTF-8')."</textarea>\n";
             //                } else {
             //                    $html .= "<input type='text' name='langstrings_".$this->id."_substring_$value[langstring_entries_id]_string' size='44' value='".htmlspecialchars($value['value'], ENT_QUOTES, 'UTF-8')."'>\n";
             //                }
             //
             //                $html .= "<div class='admin_element_data' id='langstrings_".$this->id."_substring_$value[langstring_entries_id]_language_section' style='display: none;'>\n";
             //                $html .= LocaleList::GenererFormSelect("$value[locales_id]", "langstrings_".$this->id."_substring_$value[langstring_entries_id]_language", null, TRUE);
             //                $html .= "</div>\n";
             //
             //                $html .= "</div>\n";
             //                $html .= "<div class='admin_element_tools'>\n";
             //                $name = "langstrings_".$this->id."_substring_$value[langstring_entries_id]_erase";
             //
             //                // Choose language button
             //                $html .= "<a href='javascript:showHideView(\"langstrings_".$this->id."_substring_$value[langstring_entries_id]_language_section\", \"langstrings_".$this->id."_substring_$value[langstring_entries_id]_language_section_image\");'><img src='" . BASE_SSL_PATH . "images/icons/language.gif' id='langstrings_".$this->id."_substring_$value[langstring_entries_id]_language_section_image' class='admin_section_button' alt='"._("Choose language")."' title='"._("Choose language")."'></a>";
             //
             //                // Add string button
             //                if (count($result) == $variantsCounter) {
             //                    // This is the last string variant - show "add string" button.
             //                    $html .= "<a href='javascript:showHideView(\"langstrings_".$this->id."_add_new_entry_view\", \"langstrings_".$this->id."_add_new_entry_image\");'><img src='" . BASE_SSL_PATH . "images/icons/add.gif' id='langstrings_".$this->id."_add_new_entry_image' class='admin_section_button' alt='"._("Add new string")."' title='"._("Add new string")."'></a>";
             //                } else {
             //                    $html .= "<img src='" . BASE_SSL_PATH . "images/icons/add.gif' id='langstrings_".$this->id."_add_new_entry_image' class='admin_section_button_disabled' alt='"._("Add new string")."' title='"._("Add new string")."'>";
             //                }
             //
             //                // Delete string button
             //                $html .= "<input type='image' name='$name' class='admin_section_button' src='" . BASE_SSL_PATH . "images/icons/delete.gif' alt='"._("Delete string")."' title='"._("Delete string")."'>";
             //
             //                $html .= "</div>\n";
             //                $html .= "</li>\n";
             $html .= "<li class='admin_element_item_container'>\n";
             $html .= "<div class='admin_element_data'>\n";
             $html .= _("Language") . ": " . LocaleList::GenererFormSelect("{$value['locales_id']}", "langstrings_" . $this->id . "_substring_{$value['langstring_entries_id']}_language", null, TRUE);
             if ($type_interface == 'LARGE') {
                 $html .= "<textarea name='langstrings_" . $this->id . "_substring_{$value['langstring_entries_id']}_string' class='textarea' cols='60' rows='3'>" . htmlspecialchars($value['value'], ENT_QUOTES, 'UTF-8') . "</textarea>\n";
             } else {
                 $html .= "<input type='text' size='80' class='input_text' name='langstrings_" . $this->id . "_substring_{$value['langstring_entries_id']}_string' value='" . htmlspecialchars($value['value'], ENT_QUOTES, 'UTF-8') . "'>\n";
             }
             $html .= "</div>\n";
             $html .= "<div class='admin_element_tools'>\n";
             $name = "langstrings_" . $this->id . "_substring_{$value['langstring_entries_id']}_erase";
             $html .= "<input type='submit' class='submit' name='{$name}' value='" . _("Delete string") . "'>";
             $html .= "</div>\n";
             $html .= "</li>\n";
         }
     }
     //        The next lines are a preview of a new suggested input mode
     //        ==========================================================
     //
     //        //Nouvelles chaîne
     //        $locale = LocaleList :: GetDefault();
     //
     //        $html .= "<li class='admin_element_item_container' id='langstrings_".$this->id."_add_new_entry_view'" . ($_hideNewContent ? " style='display: none;'" : "") . ">\n";
     //        $html .= "<div class='admin_element_data'>\n";
     //
     //        $new_substring_name = "langstrings_".$this->id."_substring_new_string";
     //
     //        if ($type_interface == 'LARGE') {
     //            $html .= "<textarea name='$new_substring_name' cols='60' rows='3'></textarea>\n";
     //        } else {
     //            $html .= "<input type='text' name='$new_substring_name' size='44' value=''>\n";
     //        }
     //
     //        $html .= "<div class='admin_element_data' id='langstrings_".$this->id."_substring_new_language_section'>\n";
     //        $html .= "<img src='" . BASE_SSL_PATH . "images/icons/language.gif' id='langstrings_".$this->id."_substring_new_language_section_image' class='admin_section_button' alt='"._("Choose language")."' title='"._("Choose language")."'>";
     //        $html .= LocaleList::GenererFormSelect($locale, "langstrings_".$this->id."_substring_new_language", null, TRUE);
     //        $html .= "</div>\n";
     //
     //        $html .= "</div>\n";
     //        $html .= "<div class='admin_element_tools'>\n";
     //
     //        $new_substring_submit_name = "langstrings_".$this->id."_add_new_entry";
     //
     //        // Add string button
     //        $html .= "<input type='image' name='$new_substring_submit_name' class='admin_section_button' src='" . BASE_SSL_PATH . "images/icons/add.gif' alt='"._("Add new string")."' title='"._("Add new string")."'>";
     //
     //        $html .= "</div>\n";
     //        $html .= "</li>\n";
     //
     //        $html .= "</ul>\n";
     //        $html .= "</div>\n";
     //Nouvelles chaîne
     $html .= "<li class='admin_element_item_container'>\n";
     $userData['excludeArray'] = $exclude_array;
     $userData['typeInterface'] = $type_interface;
     $html .= self::getNewUI($this->id, $userData);
     $html .= "</li>\n";
     $html .= "</ul>\n";
     return parent::getAdminUI($html, $title);
 }
Exemplo n.º 4
0
 /**
  * Retreives the admin interface of this object. Anything that overrides
  * this method should call the parent method with it's output at the END of
  * processing.
  * @param string $subclass_admin_interface HTML content of the interface
  * element of a children.
  * @param string $type_interface SIMPLE pour éditer un seul champ, COMPLETE
  *                               pour voir toutes les chaînes, LARGE pour
  *                               avoir un textarea.
  * @return string The HTML fragment for this interface.
  */
 public function getAdminUI($subclass_admin_interface = null, $title = null, $type_interface = "LARGE")
 {
     // Init values.
     $html = '';
     $html .= $subclass_admin_interface;
     $result = "";
     //$variantsCounter = 0;
     //$_hideNewContent = false;
     if (!empty($this->allowed_html_tags)) {
         $html .= "<div class='admin_section_hint'>" . _("Only these HTML tags are allowed : ") . htmlentities($this->allowed_html_tags) . "</div>";
     }
     $html .= "<ul class='admin_element_list'>\n";
     $sql = "SELECT * FROM content_langstring_entries WHERE content_langstring_entries.langstrings_id = '{$this->id}' ORDER BY locales_id";
     $this->mBd->execSql($sql, $result, false);
     //echo "type_interface: $type_interface\n";
     $exclude_array = array();
     if ($result != null) {
         while (list($key, $value) = each($result)) {
             $exclude_array[$value['locales_id']] = $value['locales_id'];
             $html .= "<li class='admin_element_item_container'>\n";
             $html .= "<div class='admin_element_data'>\n";
             $name = "langstrings_" . $this->id . "_substring_{$value['langstring_entries_id']}_language";
             $html .= "<input type='hidden' name='{$name}' value=''>\n";
             if ($type_interface == 'LARGE') {
                 $html .= "<textarea name='langstrings_" . $this->id . "_substring_{$value['langstring_entries_id']}_string' class='textarea' cols='60' rows='3'>" . htmlspecialchars($value['value'], ENT_QUOTES, 'UTF-8') . "</textarea>\n";
             } else {
                 $html .= "<input type='text' class='input_text' name='langstrings_" . $this->id . "_substring_{$value['langstring_entries_id']}_string' size='80' value='" . htmlspecialchars($value['value'], ENT_QUOTES, 'UTF-8') . "'>\n";
             }
             $html .= "</div>\n";
             $html .= "</li>\n";
         }
     }
     //Nouvelles chaîne
     if ($result == null) {
         $html .= "<li class='admin_element_item_container'>\n";
         $html .= "<div class='admin_element_data'>\n";
         $userData['typeInterface'] = $type_interface;
         $html .= self::getNewUI($this->id, $userData);
         $html .= "</div>\n";
         $html .= "</li>\n";
     }
     $html .= "</ul>\n";
     return Content::getAdminUI($html, $title);
 }
Exemplo n.º 5
0
 /**
  * Retreives the admin interface of this object. Anything that overrides
  * this method should call the parent method with it's output at the END of
  * processing.
  * @param string $subclass_admin_interface HTML content of the interface
  * element of a children.
  * @param string $type_interface SIMPLE pour éditer un seul champ, COMPLETE
  *                               pour voir toutes les chaînes, LARGE pour
  *                               avoir un textarea.
  * @return string The HTML fragment for this interface.
  */
 public function getAdminUI($subclass_admin_interface = null, $title = null, $type_interface = "LARGE")
 {
     if ($this->_FCKeditorAvailable) {
         // Init values
         $_result = null;
         $html = '';
         $html .= $subclass_admin_interface;
         $html .= "<ul class='admin_element_list'>\n";
         $html .= "<li class='admin_element_item_container content_html_editor'>\n";
         $html .= "<ul class='admin_element_list'>\n";
         $sql = "SELECT * FROM content_langstring_entries WHERE content_langstring_entries.langstrings_id = '{$this->id}' ORDER BY locales_id";
         $this->mBd->execSql($sql, $_result, FALSE);
         // Show existing content
         if ($_result != null) {
             while (list($_key, $_value) = each($_result)) {
                 $html .= "<li class='admin_element_item_container'>\n";
                 $html .= "<div class='admin_element_data'>\n";
                 $html .= _("Language") . ": " . LocaleList::GenererFormSelect($_value["locales_id"], "langstrings_" . $this->id . "_substring_" . $_value["langstring_entries_id"] . "_language", null, TRUE);
                 $_FCKeditor = new FCKeditor('langstrings_' . $this->id . '_substring_' . $_value["langstring_entries_id"] . '_string');
                 $_FCKeditor->BasePath = SYSTEM_PATH . "lib/FCKeditor/";
                 $_FCKeditor->Config["CustomConfigurationsPath"] = BASE_URL_PATH . "js/HTMLeditor.js";
                 $_FCKeditor->Config["AutoDetectLanguage"] = false;
                 $_FCKeditor->Config["DefaultLanguage"] = substr(Locale::getCurrentLocale()->getId(), 0, 2);
                 $_FCKeditor->Config["StylesXmlPath"] = BASE_URL_PATH . "templates/HTMLeditor/css/" . substr(Locale::getCurrentLocale()->getId(), 0, 2) . ".xml";
                 $_FCKeditor->Config["TemplatesXmlPath"] = BASE_URL_PATH . "templates/HTMLeditor/templates/" . substr(Locale::getCurrentLocale()->getId(), 0, 2) . ".xml";
                 $_FCKeditor->ToolbarSet = "WiFiDOG";
                 $_FCKeditor->Value = $_value['value'];
                 if ($type_interface == 'LARGE') {
                     $_FCKeditor->Height = 400;
                 } else {
                     $_FCKeditor->Height = 200;
                 }
                 $_FCKeditor->Width = 386;
                 $html .= $_FCKeditor->CreateHtml();
                 $html .= "</div>\n";
                 $html .= "<div class='admin_element_tools'>\n";
                 $_name = "langstrings_" . $this->id . "_substring_" . $_value["langstring_entries_id"] . "_erase";
                 $html .= "<input type='submit' class='submit' name='{$_name}' value='" . _("Delete string") . "'>";
                 $html .= "</div>\n";
                 $html .= "</li>\n";
             }
         }
         // Editor for new content
         $html .= "<li class='admin_element_item_container'>\n";
         $userData['typeInterface'] = $type_interface;
         $html .= self::getNewUI($this->id, $userData);
         $html .= "</li>\n";
         $html .= "</ul>\n";
         $html .= "</li>\n";
         $html .= "</ul>\n";
     } else {
         $html = '';
         $html .= _("FCKeditor is not installed");
     }
     return Content::getAdminUI($html, $title);
 }
Exemplo n.º 6
0
 /**
  * Shows the administration interface for RssAggregator
  *
  * @param string $subclass_admin_interface HTML code to be added after the
  *                                         administration interface
  *
  * @return string HTML code for the administration interface
  */
 public function getAdminUI($subclass_admin_interface = null, $title = null)
 {
     $this->initFeedPressReview();
     $db = AbstractDb::getObject();
     // Init values
     $html = '';
     $feed_urls = null;
     $tab = array();
     $i = 0;
     $html .= "<ul class='admin_element_list'>\n";
     /*
      * number_of_display_items
      */
     $html .= "<li class='admin_element_item_container'>\n";
     $html .= "<div class='admin_element_label'>" . _("Total number of items to display (from all feeds)") . ": </div>\n";
     $html .= "<div class='admin_element_data'>\n";
     $name = "rss_aggregator_" . $this->id . "_display_num_items";
     $value = $this->getDisplayNumItems();
     $html .= "<input type='text' size='2' value='{$value}' name='{$name}'>\n";
     $html .= "</div>\n";
     $html .= "</li>\n";
     /*
      * algorithm_strength
      */
     $html .= "<li class='admin_element_item_container'>\n";
     $html .= "<div class='admin_element_label'>\n";
     $title = _("How much bonus feeds that do not publish as often get over feed that publish more often.\n                                            The default is 0.75, with a typical range between 0 and 1.\n                                            At 0, you have a classic RSS aggregator, meaning the n most recent entries picked from all feeds\n                                            will be displayed. 1 is usually as high as you'll want to go:  Assuming that all feeds have \n                                            an homogenous internal distribution (ex:  one feed publishes exactly one entry a day, the\n                                            second once every two days, and the third once every three days), and you ask for 15 entries,\n                                            there will be 5 of each.  While that may not sound usefull, it still is, as the feed's distribution is\n                                            usually not homogenous.");
     $html .= "<a href=\"#\" title=\"{$title}\">" . _("Algorithm Strength") . "</a>\n";
     $html .= ": </div>\n";
     $html .= "<div class='admin_element_data'>\n";
     $name = "rss_aggregator_" . $this->id . "_algorithm_strength";
     $value = $this->getAlgorithmStrength();
     $html .= "<input type='text' size='2' value='{$value}' name='{$name}'>\n";
     $html .= "</div>\n";
     $html .= "</li>\n";
     /*
      * feed_expansion
      */
     $html .= "<li class='admin_element_item_container'>\n";
     $html .= "<div class='admin_element_label'>\n";
     $title = _("Set the criteria that determines which feed items will be shown expanded by default.");
     $html .= "<a href=\"#\" title=\"{$title}\">" . _("Feed item expansion criteria") . "</a>\n";
     $html .= ": </div>\n";
     $html .= "<div class='admin_element_data'>\n";
     $array = FeedPressReview::getFeedExpansionAllowedOptions();
     $value = $this->getFeedExpansionMode();
     $name = "rss_aggregator_" . $this->id . "_feed_expansion";
     $html .= FormSelectGenerator::generateFromKeyLabelArray($array, $value, $name, null, false);
     $html .= "</div>\n";
     $html .= "</li>\n";
     /*
      * feed_ordering
      */
     $html .= "<li class='admin_element_item_container'>\n";
     $html .= "<div class='admin_element_label'>\n";
     $title = _("Set in which order the feeds are displayed, and if items from all source should be merged together");
     $html .= "<a href=\"#\" title=\"{$title}\">" . _("Item ordering") . "</a>\n";
     $html .= ": </div>\n";
     $html .= "<div class='admin_element_data'>\n";
     $array = FeedPressReview::getFeedOrderingAllowedOptions();
     $value = $this->getFeedOrdering();
     $name = "rss_aggregator_" . $this->id . "_feed_ordering";
     $html .= FormSelectGenerator::generateFromKeyLabelArray($array, $value, $name, null, false);
     $html .= "</div>\n";
     $html .= "</li>\n";
     /*
      * display_empty_feeds
      */
     $html .= "<li class='admin_element_item_container'>\n";
     $html .= "<div class='admin_element_label'>" . _("Display empty feeds?") . ": </div>\n";
     $html .= "<div class='admin_element_data'>\n";
     $name = "rss_aggregator_" . $this->id . "_display_empty_feeds";
     $this->getDisplayEmptyFeed() ? $checked = 'CHECKED' : ($checked = '');
     $html .= "<input type='checkbox' name='{$name}' {$checked}>\n";
     $html .= "</div>\n";
     $html .= "</li>\n";
     /*
      * max_item_age
      */
     $html .= "<li class='admin_element_item_container'>\n";
     $html .= "<div class='admin_element_label'>\n";
     $title = _("Set the oldest entries (in seconds) you are willing to see.  Any entries older than this will not\n                                            be considered at all for display, even if it means that the configured number of items to be displayed isn't reached.\n                                            It's only usefull if all your feed publish very rarely, and you don't want very old entries to show up.");
     $html .= "<a href=\"#\" title=\"{$title}\">" . _("Maximum age (seconds)") . "</a>\n";
     $html .= ": </div>\n";
     $html .= "<div class='admin_element_data'>\n";
     $name = "rss_aggregator_" . $this->id . "_max_item_age";
     $value = $this->getMaxItemAge();
     $html .= "<input type='text' size='10' value='{$value}' name='{$name}'>\n";
     $html .= _("seconds");
     $html .= "</div>\n";
     $html .= "</li>\n";
     /*
      * rss_aggregator_element (table)
      */
     $html .= "<li class='admin_element_item_container'>\n";
     $html .= "<div class='admin_element_label'>" . _("Feeds:") . "</div>\n";
     $html .= "<ul class='admin_element_list'>\n";
     foreach ($this->content_rss_aggregator_feeds_rows as $feed_row) {
         $html .= "<li class='admin_element_item_container'>\n";
         $html .= "<div class='admin_element_data'>\n";
         $html .= $this->getFeedAdminUI($feed_row);
         $html .= "</div'>\n";
         $html .= "<div class='admin_element_tools'>\n";
         /*
          * Delete feeds
          */
         $name = "rss_aggregator_" . $this->id . "_feed_" . md5($feed_row['url']) . "_delete";
         $html .= "<input type='submit' name='{$name}' value='" . _("Delete") . "'>";
         $html .= "</div>\n";
         $html .= "</li>\n";
     }
     /*
      * Add new feed
      */
     $html .= "<li class='admin_element_item_container'>\n";
     $html .= "<b>" . _("Add a new feed or pick one from the other feeds in the system (most_popular_first)") . "</b><br>";
     $sql = "SELECT DISTINCT ON (count, content_rss_aggregator_feeds.url) count, content_rss_aggregator_feeds.url, title FROM content_rss_aggregator_feeds\n                                        JOIN (SELECT url, count(content_rss_aggregator_feeds.url) as count\n                                        FROM content_rss_aggregator_feeds\n                                        WHERE content_rss_aggregator_feeds.url NOT IN (SELECT url FROM content_rss_aggregator_feeds WHERE content_id='{$this->id}')\n                                        GROUP BY content_rss_aggregator_feeds.url, content_rss_aggregator_feeds.url)\n                                        AS available_feeds\n                                        ON (available_feeds.url=content_rss_aggregator_feeds.url)\n                                        ORDER by count desc, content_rss_aggregator_feeds.url DESC";
     $db->execSql($sql, $feed_urls, false);
     if ($feed_urls) {
         foreach ($feed_urls as $feed_row) {
             $tab[$i][0] = $feed_row['url'];
             empty($feed_row['title']) ? $title = $feed_row['url'] : ($title = $feed_row['title']);
             $tab[$i][1] = sprintf(_("%s, used %d times"), $title, $feed_row['count']);
             $i++;
         }
     }
     $name = "rss_aggregator_{$this->id}_feed_add";
     $html .= "<input type='text' size='60' value='' name='{$name}' id='{$name}'>\n";
     $html .= FormSelectGenerator::generateFromArray($tab, null, 'existing_feeds', 'RssAggregator', true, _('Type URL manually'), "onchange='this.form.{$name}.value=this.value;'");
     $name = "rss_aggregator_{$this->id}_feed_add_button";
     $html .= "<input type='submit' name='{$name}' value='" . _("Add") . "'>";
     $html .= "</li>\n";
     $html .= "</ul>\n";
     $html .= "</li>\n";
     $html .= "</ul>\n";
     $html .= $subclass_admin_interface;
     return parent::getAdminUI($html, $title);
 }
Exemplo n.º 7
0
 /**
  * Shows the administration interface for ContentGroupElement
  *
  * @param string $subclass_admin_interface HTML code to be added after the
  *                                         administration interface
  *
  * @return string HTML code for the administration interface
  */
 public function getAdminUI($subclass_admin_interface = null, $title = null)
 {
     $db = AbstractDb::getObject();
     // Init values
     $html = '';
     $html .= "<li class='admin_element_item_container'>\n";
     $html .= "<fieldset class='admin_element_group'>\n";
     $html .= "<legend>" . sprintf(_("%s %d display conditions"), get_class($this), $this->getDisplayOrder()) . "</legend>\n";
     $allowed_node_rows = null;
     $html .= "<ul class='admin_element_list'>\n";
     /* display_order */
     $html .= "<li class='admin_element_item_container'>\n";
     $html .= "<div class='admin_element_label'>Display order: </div>\n";
     $html .= "<div class='admin_element_data'>\n";
     $name = "content_group_element_" . $this->id . "_display_order";
     $html .= "<input type='text' name='{$name}' value='" . $this->getDisplayOrder() . "' size='2'>\n";
     $html .= _("(Ignored if display type is random)") . "\n";
     $html .= "</div>\n";
     $html .= "</li>\n";
     $html .= "<li class='admin_element_item_container'>\n";
     // valid_from_timestamp
     $title_str = _("Content can be displayed at any date if no start or end date is specified.  Warning:  If you do not specify a specific time of day, midnight is assumed.");
     $html .= "<a href=\"#\" title=\"{$title_str}\">" . _("Only display from") . "</a>\n";
     $html .= "<div class='admin_element_data'>\n";
     $name = "content_group_element_" . $this->id . "_valid_from";
     $datetime_from = new DateTimeWD($this->getValidFromDate());
     $html .= DateTimeWD::getSelectDateTimeUI($datetime_from, $name, DateTimeWD::INTERFACE_DATETIME_FIELD, null);
     $html .= "</div>\n";
     // valid_until_timestamp
     $html .= "<div class='admin_element_label'>until</div>\n";
     $html .= "<div class='admin_element_data'>\n";
     $name = "content_group_element_" . $this->id . "_valid_until";
     $datetime_untill = new DateTimeWD($this->getValidUntilDate());
     $html .= DateTimeWD::getSelectDateTimeUI($datetime_untill, $name, DateTimeWD::INTERFACE_DATETIME_FIELD, null);
     $html .= "</div>\n";
     if (!$datetime_from->isEmpty() && $datetime_from->getTimestamp() > time()) {
         $html .= "<div class=warningmsg>Element not yet displayed</div>\n";
     }
     if (!$datetime_untill->isEmpty() && $datetime_untill->getTimestamp() < time()) {
         $html .= "<div class=warningmsg>Element has expired</div>\n";
     }
     $html .= "</li>\n";
     /* content_group_element_has_allowed_nodes */
     $html .= "<li class='admin_element_item_container'>\n";
     $html .= "<div class='admin_element_label'>" . _("Only display at node(s):") . _(" (DEPRECATED should use NodeGroups instead)") . "</div>\n";
     $html .= "<ul class='admin_element_list'>\n";
     $sql = "SELECT * FROM content_group_element_has_allowed_nodes WHERE content_group_element_id='{$this->id}'";
     $db->execSql($sql, $allowed_node_rows, false);
     if ($allowed_node_rows != null) {
         foreach ($allowed_node_rows as $allowed_node_row) {
             $node = Node::getObject($allowed_node_row['node_id']);
             $html .= "<li class='admin_element_item_container'>\n";
             $html .= "<div class='admin_element_data'>\n";
             $html .= "" . $node->GetId() . ": " . $node->GetName() . "";
             $html .= "</div>\n";
             $html .= "<div class='admin_element_tools'>\n";
             $name = "content_group_element_" . $this->id . "_allowed_node_" . $node->GetId() . "_remove";
             $html .= "<input type='submit' name='{$name}' value='" . _("Remove") . "'>";
             $html .= "</div>\n";
             $html .= "</li>\n";
         }
     }
     $html .= "<li class='admin_element_item_container'>\n";
     $userDataNode['additionalWhere'] = "AND node_id NOT IN (SELECT node_id FROM content_group_element_has_allowed_nodes WHERE content_group_element_id='{$this->id}')";
     $name = "content_group_element_{$this->id}_new_allowed_node";
     $html .= Node::getSelectUI($name, $userDataNode);
     $name = "content_group_element_{$this->id}_new_allowed_node_submit";
     $html .= "<input type='submit' name='{$name}' value='" . _("Add new allowed node") . "'>";
     $html .= "</li'>\n";
     $html .= "</ul>\n";
     $html .= _("(Content can be displayed at ANY node unless one or more nodes are selected)") . "\n";
     $html .= "</li>\n";
     $html .= "</fieldset>\n";
     $html .= "</li>\n";
     /* displayed_content_id */
     $html .= "<li class='admin_element_item_container'>\n";
     if (empty($this->content_group_element_row['displayed_content_id'])) {
         $html .= "<div class='errormsg'>Sorry, display element is missing.</div>\n";
         /*        	$html .= "<fieldset class='admin_element_group'>\n";
                    $html .= "<legend>"._("Add a new displayed content OR select an existing one")."</legend>\n";
                    $html .= self :: getNewContentUI("content_group_element_{$this->id}_new_displayed_content")."<br>";
                    $html .= self :: getSelectExistingContentUI("content_group_element_{$this->id}_new_displayed_existing_element", "AND content_id != '$this->id'");
                    $html .= "</fieldset>\n";*/
     } else {
         $displayed_content = self::getObject($this->content_group_element_row['displayed_content_id']);
         $html .= $displayed_content->getAdminUI(null, sprintf(_("%s %d displayed content (%s)"), get_class($this), $this->getDisplayOrder(), get_class($displayed_content)));
         /*$html .= "<div class='admin_element_tools'>\n";
           $name = "content_group_element_{$this->id}_erase_displayed_content";
           $html .= "<input type='submit' name='$name' value='"._("Delete")."'>";
           $html .= "</div>\n";*/
     }
     $html .= "</li>\n";
     $html .= $subclass_admin_interface;
     return parent::getAdminUI($html, $title);
 }
Exemplo n.º 8
0
 /**
  * Shows the administration interface for IFrame
  *
  * @param string $subclass_admin_interface HTML code to be added after the
  *                                         administration interface
  *
  * @return string HTML code for the administration interface
  */
 public function getAdminUI($subclass_admin_interface = null, $title = null)
 {
     // Init values
     $html = '';
     $html .= "<ul class='admin_element_list'>\n";
     $html .= "<li class='admin_element_item_container'>\n";
     $html .= "<div class='admin_element_data'>\n";
     $html .= "<div class='admin_element_label'>" . _("Width (suggested width is 600 (pixels))") . " : </div>\n";
     $name = "iframe_" . $this->id . "_width";
     $html .= "<input type='text' name='{$name}' value='{$this->getWidth()}'>";
     $html .= "</div>\n";
     $html .= "</li>\n";
     $html .= "<li class='admin_element_item_container'>\n";
     $html .= "<div class='admin_element_data'>\n";
     $name = "iframe_" . $this->id . "_height";
     $html .= "<div class='admin_element_label'>" . _("Height (suggested width is 400 (pixels))") . " : </div>\n";
     $html .= "<input type='text' name='{$name}' value='{$this->getHeight()}'>";
     $html .= "</div>\n";
     $html .= "</li>\n";
     $html .= "<li class='admin_element_item_container'>\n";
     $html .= "<div class='admin_element_data'>\n";
     $html .= "<div class='admin_element_label'>" . _("HTML content URL") . " : </div>\n";
     $name = "iframe_" . $this->id . "_url";
     $html .= "<input type='text' size=80 name='{$name}' value='" . $this->getUrl() . "'\n";
     $html .= "</div>\n";
     $html .= "</li>\n";
     $html .= "</ul>\n";
     $html .= $subclass_admin_interface;
     return parent::getAdminUI($html, $title);
 }
Exemplo n.º 9
0
 public function getAdminUI($subclass_admin_interface = null, $title = null)
 {
     $html = null;
     /*display_num_items*/
     $displayNumItems = $this->getDisplayNumItems();
     $html .= "<li class='admin_element_item_container'>\n";
     $html .= "<div class='admin_element_label'>" . "Number of shouts to display in the list (0 means no limit)" . ": </div>\n";
     $html .= "<div class='admin_element_data'>\n";
     $name = "shoutbox_{this->getId()}_display_num_items";
     $html .= "<input type='text' size='6' value='{$displayNumItems}' name='{$name}'>\n";
     $html .= "</div>\n";
     $html .= "</li>\n";
     /*max_shout_chars*/
     $maxShoutChars = $this->getMaxShoutChars();
     $html .= "<li class='admin_element_item_container'>\n";
     $html .= "<div class='admin_element_label'>" . "Maximum number of characters for each shouts (0 means no limit)" . ": </div>\n";
     $html .= "<div class='admin_element_data'>\n";
     $name = "shoutbox_{this->getId()}_max_num_chars";
     $html .= "<input type='text' size='6' value='{$maxShoutChars}' name='{$name}'>\n";
     $html .= "</div>\n";
     $html .= "</li>\n";
     /*shout_field_size*/
     $shoutFieldSize = $this->getShoutFieldSize();
     $html .= "<li class='admin_element_item_container'>\n";
     $html .= "<div class='admin_element_label'>" . "Size (num characters) of the shout field" . ": </div>\n";
     $html .= "<div class='admin_element_data'>\n";
     $name = "shoutbox_{this->getId()}_shout_field_size";
     $html .= "<input type='text' size='6' value='{$shoutFieldSize}' name='{$name}'>\n";
     $html .= "</div>\n";
     $html .= "</li>\n";
     /* OnclickContent */
     $criteria_array = array(array('isTextualContent'), array('isSimpleContent'));
     $onclick_allowed_content_types = ContentTypeFilter::getObject($criteria_array);
     $content = $this->getOnClickContent();
     $html .= "<li class='admin_element_item_container admin_section_edit_description'>\n";
     $html .= "<div class='admin_element_data'>\n";
     $onclick_title = _("Shout button 'onclick=' value (optionnal):");
     if (!$content) {
         $name = "shoutbox_" . $this->id . "_onclick_content_new";
         $html .= self::getNewContentUI($name, $onclick_allowed_content_types, $onclick_title);
         $html .= $hint;
     } else {
         $html .= $content->getAdminUI(null, $onclick_title);
         $html .= "<div class='admin_section_hint'>" . sprintf(_("Note that the onclick parameter will appear inside double quotes in html.  They must be properly encoded fot that context.  You can access the shout text in Javascript with: %s"), "document.getElementById('shout_text').value") . "</div>\n";
         $html .= "</div>\n";
         $html .= "<div class='admin_element_tools'>\n";
         $name = "shoutbox_" . $this->id . "_onclick_content_erase";
         $html .= "<input type='submit' class='submit' name='{$name}' value='" . sprintf(_("Delete %s (%s)"), _("onclick parameter"), get_class($content)) . "'>";
     }
     $html .= "</div>\n";
     $html .= "</li>\n";
     return parent::getAdminUI($html, $title);
 }
Exemplo n.º 10
0
 /**
  * Shows the administration interface for RssAggregator.
  *
  * @param string $subclass_admin_interface HTML code to be added after the
  *                                         administration interface
  *
  * @return string HTML code for the administration interface
  */
 public function getAdminUI($subclass_admin_interface = null, $title = null)
 {
     // Init values
     $html = '';
     $html .= "<li class='admin_element_item_container'>\n";
     $html .= "<div class='admin_element_data'>\n";
     $html .= "<input type='radio' name='file_mode" . $this->getId() . "' value='by_upload' " . ($this->isLocalFile() ? "CHECKED" : "") . " />";
     $html .= _("Upload a new file (Uploading a new one will replace any existing file)") . " : \n";
     $html .= '<input type="hidden" name="MAX_FILE_SIZE" value="1073741824" />';
     $html .= '<input name="file_file_upload' . $this->getId() . '" type="file" />';
     $html .= "</div>\n";
     $html .= "</li>\n";
     $html .= "<li class='admin_element_item_container'>\n";
     $html .= "<div class='admin_element_data'>\n";
     $html .= "<input type='radio' name='file_mode" . $this->getId() . "' value='remote' " . (!$this->isLocalFile() ? "CHECKED" : "") . ">";
     $html .= _("Remote file via URL") . " : \n";
     if ($this->isLocalFile()) {
         $html .= "<input name='file_url" . $this->getId() . "' type='text' size='50'/>";
     } else {
         $html .= "<input name='file_url" . $this->getId() . "' type='text' size='50' value='" . $this->getFileUrl() . "'/>";
     }
     $html .= "</div>\n";
     $html .= "</li>\n";
     if (!$this->isLocalFile()) {
         $html .= "<div class='admin_element_item_container'>\n";
         $html .= "<div class='admin_element_label'>" . _("File URL") . " : </div>\n";
         $html .= "<div class='admin_element_data'>\n";
         $html .= $this->getFileUrl();
         $html .= "</div>\n";
         $html .= "</li>\n";
     }
     if ($this->configEnableEditFilename) {
         $html .= "<li class='admin_element_item_container'>\n";
         $html .= "<div class='admin_element_label'>" . _("Filename to display") . " : </div>\n";
         $html .= "<div class='admin_element_data'>\n";
         $html .= '<input type="text" name="file_file_name' . $this->getId() . '" value="' . $this->getFilename() . '" />';
         $html .= "</div>\n";
         $html .= "</li>\n";
     }
     if ($this->isLocalFile()) {
         if ($this->configEnableEditMimeType) {
             $html .= "<li class='admin_element_item_container'>\n";
             $html .= "<div class='admin_element_label'>" . _("MIME type") . " : </div>\n";
             $html .= "<div class='admin_element_data'>\n";
             $html .= '<input type="text" name="file_mime_type' . $this->getId() . '" value="' . $this->getMimeType() . '" />';
             $html .= "</div>\n";
             $html .= "</li>\n";
         }
         //$html .= "<li class='admin_element_item_container'>\n";
         if ($this->isFileMetadataVerbose() == true) {
             $html .= "<div class='admin_element_data'>" . _("Locally stored file size") . " : \n";
             $html .= $this->getFileSize(self::UNIT_KILOBYTES) . " " . _("KB");
         }
     } else {
         $html .= "<div class='admin_element_item_container'>\n";
         $html .= "<div class='admin_element_label'>" . _("Remote file size (Automatically converted from KB to Bytes)") . " : </div>\n";
         $html .= "<div class='admin_element_data'>\n";
         // The hidden field contains old value to determine if we have to update ( this prevents unwanted successive floating point evaluation )
         $html .= '<input type="hidden" name="file_old_remote_size' . $this->getId() . '" value="' . $this->getFileSize() . '" />';
         $html .= '<input type="text" name="file_remote_size' . $this->getId() . '" value="' . $this->getFileSize() . '" />';
     }
     if ($this->isFileMetadataVerbose() == true) {
         $html .= " <a href='" . $this->getFileUrl() . "'>" . _("Download") . "</a>\n";
         $html .= " " . _("Last update") . " : \n";
         $html .= $this->getLastUpdateTimestamp();
         $html .= "</div>\n";
     }
     $html .= "</li>\n";
     $html .= $subclass_admin_interface;
     return parent::getAdminUI($html, $title);
 }
Exemplo n.º 11
0
 /**
  * Shows the administration interface for embedded content.
  *
  * @param string $subclass_admin_interface HTML code to be added after the
  *                                         administration interface
  *
  * @return string HTML code for the administration interface
  */
 public function getAdminUI($subclass_admin_interface = null, $title = null)
 {
     $html = '';
     $html .= "<ul class='admin_element_list'>\n";
     /* Embedded content Content */
     $html .= "<li class='admin_element_item_container'>\n";
     $html .= "<div class='admin_element_label'>" . _("Embedded content") . " : <br></div>\n";
     $html .= "<div class='admin_element_data'>\n";
     if (empty($this->embedded_content_row['embedded_file_id'])) {
         // Mandate File
         $criteria_array = array(array('isContentType', array(array('File'))));
         $html .= self::getNewContentUI("embedded_file_{$this->id}_new", ContentTypeFilter::getObject($criteria_array));
         $html .= "</div>\n";
     } else {
         $embedded_content_file = self::getObject($this->embedded_content_row['embedded_file_id']);
         $html .= $embedded_content_file->getAdminUI();
         $html .= "</div>\n";
         $html .= "<div class='admin_element_tools'>\n";
         $name = "embeddedcontent_" . $this->id . "_embedded_file_erase";
         $html .= "<li class='admin_element_item_container'>\n";
         $html .= "<div class='admin_element_label'>" . _("Attributes") . " : </div>\n";
         $html .= "<div class='admin_element_data'>\n";
         $html .= "<br><i>" . _("It is recommended to specify at least <b>width='x' height='y'</b> as attributes") . "</i><br>\n";
         $html .= '<textarea name="embedded_content_attributes' . $this->getId() . '" cols="60" rows="3">' . htmlspecialchars($this->getAttributes(), ENT_QUOTES, 'UTF-8') . '</textarea>';
         $html .= "</div>\n";
         $html .= "</li>\n";
         $html .= "<li class='admin_element_item_container'>\n";
         $html .= "<div class='admin_element_label'>" . _("Parameters") . " : </div>\n";
         $html .= "<div class='admin_element_data'>\n";
         $html .= '<br><textarea name="embedded_content_parameters' . $this->getId() . '" cols="60" rows="3">' . htmlspecialchars($this->getParameters(), ENT_QUOTES, 'UTF-8') . '</textarea>';
         $html .= "</div>\n";
         $html .= "</li>\n";
         $html .= "<input type='submit' name='{$name}' value='" . _("Delete") . "'>";
         $html .= "</div>\n";
     }
     $html .= "</li>\n";
     /* Fallback content */
     $html .= "<div class='admin_element_item_container'>\n";
     $html .= "<div class='admin_element_label'>" . _("Fallback content (Can be another embedded content to create a fallback hierarchy)") . " : <br></div>\n";
     $html .= "<div class='admin_element_data'>\n";
     if (empty($this->embedded_content_row['fallback_content_id'])) {
         //Textual content make sense for fallback content, su just exclude ContentGroup
         $criteria_array = array(array('isNotContentType', array(array('ContentGroup'))));
         $html .= self::getNewContentUI("fallback_content_{$this->id}_new", ContentTypeFilter::getObject($criteria_array));
         $html .= "</div>\n";
     } else {
         $fallback_content = self::getObject($this->embedded_content_row['fallback_content_id']);
         $html .= $fallback_content->getAdminUI();
         $html .= "</div>\n";
         $html .= "<div class='admin_element_tools'>\n";
         $name = "fallback_content_" . $this->id . "_fallback_content_erase";
         $html .= "<input type='submit' name='{$name}' value='" . _("Delete") . "'>";
         $html .= "</div>\n";
     }
     $html .= "</li>\n";
     $html .= "</ul>\n";
     $html .= $subclass_admin_interface;
     return parent::getAdminUI($html, $title);
 }
Exemplo n.º 12
0
 public function getAdminUI($subclass_admin_interface = null, $title = null)
 {
     $html = '';
     $html .= "<fieldset class='admin_element_group'>\n";
     $html .= "<legend>" . sprintf(_("%s configuration"), get_class($this)) . "</legend>\n";
     /* content_ordering_mode */
     $html .= "<li class='admin_element_item_container'>\n";
     $html .= "<div class='admin_element_label'>" . _("In what order should the content displayed?") . ": </div>\n";
     $html .= "<div class='admin_element_data'>\n";
     $name = "content_group_" . $this->id . "_content_ordering_mode";
     $html .= FormSelectGenerator::generateFromKeyLabelArray($this->CONTENT_ORDERING_MODES, $this->getContentOrderingMode(), $name, null, false);
     $html .= "</div>\n";
     $html .= "</li>\n";
     /*content_changes_on_mode */
     $html .= "<li class='admin_element_item_container'>\n";
     $html .= "<div class='admin_element_label'>" . _("When does the content rotate?") . ": </div>\n";
     $html .= "<div class='admin_element_data'>\n";
     $name = "content_group_" . $this->id . "_content_changes_on_mode";
     $html .= FormSelectGenerator::generateFromKeyLabelArray($this->CONTENT_CHANGES_ON_MODES, $this->getContentChangesOnMode(), $name, null, false);
     $html .= "</div>\n";
     $html .= "</li>\n";
     /* allow_repeat*/
     $html .= "<li class='admin_element_item_container'>\n";
     $html .= "<div class='admin_element_label'>" . _("Can content be shown more than once to the same user?") . ": </div>\n";
     $html .= "<div class='admin_element_data'>\n";
     $name = "content_group_" . $this->id . "_allow_repeat";
     $html .= FormSelectGenerator::generateFromKeyLabelArray($this->ALLOW_REPEAT_MODES, $this->getAllowRepeat(), $name, null, false);
     $html .= "</div>\n";
     $html .= "</li>\n";
     /*display_num_elements*/
     $html .= "<li class='admin_element_item_container'>\n";
     $html .= "<div class='admin_element_label'>" . _("Pick how many elements for each display?") . ": </div>\n";
     $html .= "<div class='admin_element_data'>\n";
     $name = "content_group_" . $this->id . "_display_num_elements";
     $value = $this->getDisplayNumElements();
     $html .= "<input type='text' size='2' value='{$value}' name='{$name}'>\n";
     $html .= "</div>\n";
     $html .= "</li>\n";
     /* Subclass UI */
     $html .= $subclass_admin_interface;
     $html .= "</fieldset>\n";
     $html .= "<li class='admin_element_item_container'>\n";
     $html .= "<fieldset class='admin_element_group'>\n";
     $html .= "<legend>" . sprintf(_("%s display element list"), get_class($this)) . "</legend>\n";
     /* content_group_element*/
     $name = "content_group_" . $this->id . "_show_expired_elements_request";
     if (empty($_REQUEST[$name])) {
         $showExpired = false;
         $additionalWhere = "AND (valid_until_timestamp IS NULL OR valid_until_timestamp >= CURRENT_TIMESTAMP) \n";
         $title_str = _("Show expired group elements");
         $html .= "<a name='group_select' onclick=\"document.getElementById('{$name}').value='" . !$showExpired . "';document.generic_object_form.submit();\">{$title_str}</a>\n";
     } else {
         $showExpired = true;
         $additionalWhere = null;
         $title_str = _("Hide expired group elements");
         $html .= "<a name='group_select' onclick=\"document.getElementById('{$name}').value='" . !$showExpired . "';document.generic_object_form.submit();\">{$title_str}</a>\n";
     }
     $html .= "<input type='hidden' name='{$name}' id='{$name}' value='{$showExpired}'>\n";
     $name = "content_group_" . $this->id . "_expired_elements_shown";
     $html .= "<input type='hidden' name='{$name}' id='{$name}' value='{$showExpired}'>\n";
     $html .= "<ul class='admin_element_list'>\n";
     foreach ($this->getElements($additionalWhere) as $element) {
         $html .= "<li class='admin_element_item_container'>\n";
         $html .= $element->getAdminUI(null, sprintf(_("%s %d"), get_class($element), $element->getDisplayOrder()));
         $html .= "<div class='admin_element_tools'>\n";
         $name = "content_group_" . $this->id . "_element_" . $element->GetId() . "_erase";
         $html .= "<input type='submit' class='submit' name='{$name}' value='" . sprintf(_("Delete %s %d"), get_class($element), $element->getDisplayOrder()) . "'>";
         $html .= "</div>\n";
         $html .= "</li>\n";
     }
     $html .= "<li class='admin_element_item_container'>\n";
     $html .= self::getNewContentUI("content_group_{$this->id}_new_element", $this->allowed_content_types);
     $html .= "</li>\n";
     $html .= "<li class='admin_element_item_container'>\n";
     $html .= self::getSelectExistingContentUI("content_group_{$this->id}_existing_element", "AND content_id != '{$this->id}' AND is_persistent=TRUE", $this->allowed_content_types);
     $html .= "</li>\n";
     $html .= "</ul>\n";
     $html .= "</fieldset>\n";
     $html .= "</li>\n";
     return parent::getAdminUI($html, $title);
 }
Exemplo n.º 13
0
 public function getAdminUI($subclass_admin_interface = null, $title = null)
 {
     // Init values
     $html = '';
     $html .= "<fieldset class='admin_element_group'>\n";
     $html .= "<legend>" . sprintf(_("%s: Options"), get_class($this)) . "</legend>\n";
     $html .= "<ul class='admin_element_list'>\n";
     if ($this->_PhlickrAvailable) {
         $generator = new FormSelectGenerator();
         $html .= "<li class='admin_element_item_container admin_section_edit_title'>\n";
         $html .= "<div class='admin_element_label'>" . _("Flickr API key") . " <a href='http://www.flickr.com/services/api/misc.api_keys.html'>(?)</a> : </div>\n";
         $html .= "<div class='admin_element_data'>\n";
         $name = "flickr_photostream_" . $this->id . "_api_key";
         $html .= "<input type='text' name='{$name}' size=40 value='" . $this->getApiKey() . "'\n";
         $html .= "</div>\n";
         $html .= "</li>\n";
         $html .= "<li class='admin_element_item_container'>\n";
         $html .= "<div class='admin_element_label'>" . _("Shared secret") . " : </div>\n";
         $html .= "<div class='admin_element_data'>\n";
         $name = "flickr_photostream_" . $this->id . "_api_shared_secret";
         $html .= "<input type='text' name='{$name}' value='" . $this->getApiSharedSecret() . "'\n";
         $html .= "</div>\n";
         $html .= "</li>\n";
         $html .= "<li class='admin_element_item_container'>\n";
         $html .= "<div class='admin_element_label'>" . _("Photos display mode") . " : </div>\n";
         $html .= "<div class='admin_element_data'>\n";
         $display_modes = array(array(0 => self::DISPLAY_GRID, 1 => _("Grid display")), array(0 => self::DISPLAY_FEATURE, 1 => _("Feature photo (last one)")), array(0 => self::DISPLAY_FEATURE_WITH_RANDOM, 1 => _("Feature photo + one at random")));
         $html .= $generator->generateFromArray($display_modes, $this->getDisplayMode(), "DisplayMode" . $this->getID(), "FlickrPhotostream", false, null);
         $html .= "</div>\n";
         $html .= "</li>\n";
         $html .= "<li class='admin_element_item_container'>\n";
         $html .= "<div class='admin_element_label'>" . _("Flick photo selection mode :") . "</div>\n";
         $html .= "<div class='admin_element_data'>\n";
         $selection_modes = array(array(0 => self::SELECT_BY_GROUP, 1 => _("Select by group")), array(0 => self::SELECT_BY_TAGS, 1 => _("Select by tags")), array(0 => self::SELECT_BY_USER, 1 => _("Select by user")));
         $html .= $generator->generateFromArray($selection_modes, $this->getSelectionMode(), "SelectionMode" . $this->getID(), "FlickrPhotostream", false, null, "onChange='submit()'");
         // Check for existing API key
         if ($this->getAPIKey()) {
             try {
                 switch ($this->getSelectionMode()) {
                     // Process common data ( User ID + User name )
                     case self::SELECT_BY_GROUP:
                     case self::SELECT_BY_USER:
                         if ($this->getFlickrUserId()) {
                             $html .= "<li class='admin_element_item_container'>\n";
                             $html .= "<div class='admin_element_label'>" . _("Flickr User ID + Username") . " : </div>\n";
                             $html .= "<div class='admin_element_data'>\n";
                             $html .= $this->getUserName() . " [" . $this->getFlickrUserId() . "]";
                             $name = "flickr_photostream_" . $this->id . "_reset_user_id";
                             $html .= " <b>( <input type='checkbox' name='{$name}' value='true'>" . _("Reset Flickr User ID") . " )</b>";
                             $html .= "</div>\n";
                             $html .= "</li>\n";
                         } else {
                             $html .= "<li class='admin_element_item_container'>\n";
                             $html .= "<div class='admin_element_label'>" . _("Flickr User E-mail") . " : </div>\n";
                             $html .= "<div class='admin_element_data'>\n";
                             $name = "flickr_photostream_" . $this->id . "_email";
                             $html .= "<input type='text' name='{$name}' value=''>";
                             $html .= "</div>\n";
                             $html .= "</li>\n";
                         }
                         break;
                 }
                 switch ($this->getSelectionMode()) {
                     case self::SELECT_BY_GROUP:
                         if ($this->getFlickrUserId()) {
                             $html .= "<li class='admin_element_item_container'>\n";
                             $html .= "<div class='admin_element_label'>" . _("Group Photo Pool") . " : </div>\n";
                             $html .= "<div class='admin_element_data'>\n";
                             $group_photo_pools = array();
                             $flickr_user = new Phlickr_User($this->getFlickrApi(), $this->getFlickrUserId());
                             $groups = array();
                             $group_photo_pools = $flickr_user->getGroupList()->getGroups();
                             foreach ($group_photo_pools as $group_photo_pool) {
                                 $groups[] = array(0 => $group_photo_pool->getId(), 1 => $group_photo_pool->getName());
                             }
                             if (count($groups) > 0) {
                                 $html .= $generator->generateFromArray($groups, $this->getGroupId(), "GroupPhotoPool" . $this->getID(), "FlickrPhotostream", false, null, "onChange='submit()'");
                             } else {
                                 $html .= _("Could not find any group photo pool.");
                             }
                             $html .= "</div>\n";
                             $html .= "</li>\n";
                         }
                         break;
                     case self::SELECT_BY_TAGS:
                         $html .= "<li class='admin_element_item_container'>\n";
                         $html .= "<div class='admin_element_label'>" . _("Tags (comma-separated)") . " : </div>\n";
                         $html .= "<div class='admin_element_data'>\n";
                         $name = "flickr_photostream_" . $this->id . "_tags";
                         $html .= "<input type='text' name='{$name}' value='" . $this->getTags() . "'>";
                         $tag_modes = array(array(0 => self::TAG_MODE_ANY, 1 => _("Match any tag")), array(0 => self::TAG_MODE_ALL, 1 => _("Match all tags")));
                         $html .= $generator->generateFromArray($tag_modes, $this->getTagMode(), "TagMode" . $this->getID(), "FlickrPhotostream", false, null, "onChange='submit()'");
                         $html .= "</div>\n";
                         $html .= "</li>\n";
                         break;
                 }
                 $html .= "<li class='admin_element_item_container'>\n";
                 $html .= "<div class='admin_element_label'>" . _("Flickr photo display options") . " : </div>\n";
                 $html .= "<div class='admin_element_data'>\n";
                 $html .= "<li class='admin_element_item_container'>\n";
                 $html .= "<div class='admin_element_label'>" . _("Show Flickr photo title ?") . " : </div>\n";
                 $html .= "<div class='admin_element_data'>\n";
                 $name = "flickr_photostream_" . $this->id . "_display_title";
                 $this->shouldDisplayTitle() ? $checked = 'CHECKED' : ($checked = '');
                 $html .= "<input type='checkbox' name='{$name}' {$checked}>\n";
                 $html .= "</div>\n";
                 $html .= "</li>\n";
                 $html .= "<li class='admin_element_item_container'>\n";
                 $html .= "<div class='admin_element_label'>" . _("Show Flickr tags ?") . " : </div>\n";
                 $html .= "<div class='admin_element_data'>\n";
                 $name = "flickr_photostream_" . $this->id . "_display_tags";
                 $this->shouldDisplayTags() ? $checked = 'CHECKED' : ($checked = '');
                 $html .= "<input type='checkbox' name='{$name}' {$checked}>\n";
                 $html .= "</div>\n";
                 $html .= "</li>\n";
                 $html .= "<li class='admin_element_item_container'>\n";
                 $html .= "<div class='admin_element_label'>" . _("Show Flickr photo description ?") . " : </div>\n";
                 $html .= "<div class='admin_element_data'>\n";
                 $name = "flickr_photostream_" . $this->id . "_display_description";
                 $this->shouldDisplayDescription() ? $checked = 'CHECKED' : ($checked = '');
                 $html .= "<input type='checkbox' name='{$name}' {$checked}>\n";
                 $html .= "</div>\n";
                 $html .= "</li>\n";
                 $html .= "<li class='admin_element_item_container'>\n";
                 $html .= "<div class='admin_element_label'>" . _("Preferred size") . " : </div>\n";
                 $html .= "<div class='admin_element_data'>\n";
                 $preferred_sizes = array(array(0 => self::SIZE_SQUARED_75x75, 1 => _("Squared 75x75")), array(0 => self::SIZE_THUMB_100x75, 1 => _("Thumbnail 100x75")), array(0 => self::SIZE_SMALL_240x180, 1 => _("Small 240x180")), array(0 => self::SIZE_MEDIUM_500x375, 1 => _("Medium 500x375")), array(0 => self::SIZE_LARGE_1024, 1 => _("Large 1024x*")), array(0 => self::SIZE_ORIGINAL, 1 => _("Original size")));
                 $html .= $generator->generateFromArray($preferred_sizes, $this->getPreferredSize(), "PreferredSize" . $this->getID(), "FlickrPhotostream", false, null, "onChange='submit()'");
                 $html .= "</div>\n";
                 $html .= "</li>\n";
                 //TODO: Add photo batch size UI support here
                 $html .= "</li>\n";
                 $html .= "</li>\n";
             } catch (Phlickr_ConnectionException $e) {
                 $html .= sprintf(_("Unable to connect to Flickr API: %s"), "<pre>{$e}</pre>");
             } catch (Phlickr_MethodFailureException $e) {
                 $html .= _("Some of the request parameters provided to Flickr API are invalid.");
             } catch (Phlickr_XmlParseException $e) {
                 $html .= _("Unable to parse Flickr's response.");
             } catch (Phlickr_Exception $e) {
                 $html .= _("Could not get content from Flickr : ") . $e;
             }
         } else {
             $html .= "<li class='admin_element_item_container'>\n";
             $html .= "<div class='admin_element_label'>" . _("YOU MUST SPECIFY AN API KEY BEFORE YOU CAN GO ON.") . "</div>\n";
             $html .= "</li>\n";
         }
         $html .= $subclass_admin_interface;
     } else {
         $html .= _("PEAR::Phlickr or PHP mudule CURL is not installed");
     }
     $html .= "</fieldset>\n";
     return parent::getAdminUI($html, $title);
 }