Skip to content

Commit

Permalink
add EsoDes
Browse files Browse the repository at this point in the history
  • Loading branch information
skywalker512 committed Jul 8, 2018
1 parent 376f3ef commit 2dc99c0
Show file tree
Hide file tree
Showing 6 changed files with 134 additions and 0 deletions.
29 changes: 29 additions & 0 deletions addons/plugins/EsoDes/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# EsoTalk Description Pluigin
Adds a description next to Forum Title.

## Installation

Upload plugin to addons/plugin folder.

Navigate to the the admin/plugins page and activate the Forum Description plugin.

## Copy the following css code to `base.css`


/* Description */
.item-description{
font-size: 14px;
color: #888888;
margin:0; display:inline;
float: left !important;
padding-top: 11px;
top: 12px;
position: absolute !important;
margin-left: -10px;
overflow: hidden;

}



# Done
Binary file added addons/plugins/EsoDes/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file.
65 changes: 65 additions & 0 deletions addons/plugins/EsoDes/plugin.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<?php
// Copyright 2015 Mustafa Bozkurt

if (!defined("IN_ESOTALK")) exit;

ET::$pluginInfo["EsoDes"] = array(
"name" => "论坛描述",
"description" => "允许管理员添加论坛描述到论坛logo之后",
"version" => "0.1",
"author" => "Mustafa Bozkurt",
"authorEmail" => "[email protected]",
"authorURL" => "http://paylasbunu.com",
"license" => "MIT",
"dependencies" => array(
"esoTalk" => "1.0.0g5"
)
);


class ETPlugin_EsoDes extends ETPlugin {

public function init()
{
ET::define("message.forumDesHelp", "You can customize view of the description via CSS.");
}

public function handler_init($sender, $menu = 0)
{
if ($forumDes = C("EsoDes.forumDes")) {
$sender->addToMenu("main", "description", "$forumDes");
$sender->addCSSFile($this->Resource("description.css"));

}
}



// 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/EsoDes");
$form->setValue("forumDes", C("EsoDes.forumDes"));

// If the form was submitted...
if ($form->validPostBack()) {

// Construct an array of config options to write.
$config = array();
$config["EsoDes.forumDes"] = $form->getValue("forumDes");

// Write the config file.
ET::writeConfig($config);

$sender->message(T("message.changesSaved"), "success autoDismiss");
$sender->redirect(URL("admin/plugins"));

}

$sender->data("EsoDesSettingsForm", $form);
return $this->view("settings");
}

}
12 changes: 12 additions & 0 deletions addons/plugins/EsoDes/resources/description.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
.item-description{
font-size: 14px;
color: #888888;
margin:0; display:inline;
float: left !important;
padding-top: 11px;
top: 12px;
position: absolute !important;
margin-left: -10px;
overflow: hidden;

}
28 changes: 28 additions & 0 deletions addons/plugins/EsoDes/views/settings.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php
// Copyright 2015 Mustafa Bozkurt

if (!defined("IN_ESOTALK")) exit;

$form = $data["EsoDesSettingsForm"];
?>
<?php echo $form->open(); ?>

<div class='section'>

<ul class='form'>

<li>
<label><?php echo T("Forum Description"); ?></label>
<?php echo $form->input("forumDes", "text"); ?>
<small><?php echo T("message.forumDesHelp"); ?></small>
</li>

</ul>

</div>

<div class='buttons'>
<?php echo $form->saveButton(); ?>
</div>

<?php echo $form->close(); ?>

0 comments on commit 2dc99c0

Please sign in to comment.