diff --git a/plugin.php b/plugin.php index bd36950..18a3222 100644 --- a/plugin.php +++ b/plugin.php @@ -77,5 +77,35 @@ public static function gambitOrderByViews(&$search, $term, $negate) $search->orderBy("c.views ".($negate ? "ASC" : "DESC")); $search->sql->useIndex("conversation_views"); } + + // Construct and process the settings form. + public function settings($sender) + { + // Set up the settings form. + $form = ETFactory::make("form"); + $form->action = URL("admin/plugins/settings/Views"); + $form->setValue("allowSearchViews",C("plugin.Views.allowSearchViews")); + + // If the form was submitted... + if ($form->validPostBack("viewsSave")) { + + // Construct an array of config options to write. + $config = array(); + $config["plugin.Views.allowSearchViews"] = $form->getValue("allowSearchViews"); + + if (!$form->errorCount()) { + + // Write the config file. + ET::writeConfig($config); + + $sender->message(T("message.changesSaved"), "success autoDismiss"); + $sender->redirect(URL("admin/plugins")); + + } + } + + $sender->data("viewsSettingsForm", $form); + return $this->view("settings"); + } } diff --git a/views/conversations/conversation.php b/views/conversations/conversation.php new file mode 100644 index 0000000..3271f4e --- /dev/null +++ b/views/conversations/conversation.php @@ -0,0 +1,76 @@ +user) $className .= " unread"; +if ($conversation["startMemberId"] == ET::$session->user) $className .= " mine"; +foreach ($conversation["labels"] as $label) $className .= " label-$label"; + +?> +