Skip to content

Commit

Permalink
plugin:FreeStyle Update for trunk, including valid XML. Several chang…
Browse files Browse the repository at this point in the history
…es due to the newer API (this appears to be from 0.5 or older).

git-svn-id: http://svn.habariproject.org/habari-extras/plugins/FreeStyle/trunk@4059 f4a90942-1786-4aa1-b092-57c31935ddc3
  • Loading branch information
mikelietz committed Nov 17, 2011
1 parent 45ddcb9 commit 5dc5561
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 42 deletions.
42 changes: 6 additions & 36 deletions freestyle.plugin.php
@@ -1,45 +1,15 @@
<?php <?php
class FreeStyle extends Plugin { class FreeStyle extends Plugin {
function info() { public function configure() {
return array(
'url' => 'http://iamgraham.net/plugins',
'name' => 'FreeStyle',
'description' => 'Allows you to inject arbitrary CSS into themes.',
'license' => 'Apache License 2.0',
'author' => 'Graham Christensen',
'authorurl' => 'http://iamgraham.net/',
'version' => '0.1'
);
}

public function filter_plugin_config($actions, $plugin_id) {
if ($plugin_id == $this->plugin_id()) {
$actions[] = _t('Configure');
}
return $actions;
}

public function action_plugin_ui($plugin_id, $action) {

if ($plugin_id == $this->plugin_id()) {
switch ($action) {
case _t('Configure'):
$ui = new FormUI(strtolower(get_class($this)));
$clientcode = $ui->add('textarea', 'css', _t('FreeStyle CSS'));

$ui->on_success(array($this, 'updated_config'));
$ui->out();
break;
}
}
}


public function updated_config($ui) { $ui = new FormUI(strtolower(get_class($this)));
return true; $clientcode = $ui->append('textarea', 'clientcode', 'freestyle__css', _t('FreeStyle CSS'));
$ui->append( 'submit', 'save', _t( 'Save' ) );
return $ui;
} }


private static function getvar($var) { private static function getvar($var) {
return Options::get('freestyle:'.$var); return Options::get('freestyle__'.$var);
} }


function action_template_header() { function action_template_header() {
Expand Down
12 changes: 6 additions & 6 deletions freestyle.plugin.xml
@@ -1,10 +1,10 @@
<plugin> <?xml version="1.0" encoding="utf-8" ?>
<pluggable type="plugin">
<url>http://iamgraham.net/plugins</url> <url>http://iamgraham.net/plugins</url>
<name>FreeStyle</name> <name>FreeStyle</name>
<description>Allows you to inject arbitrary CSS into themes.</description> <description>Allows you to inject arbitrary CSS into themes.</description>
<license>Apache License 2.0</license> <license url="http://www.apache.org/licenses/LICENSE-2.0.html">Apache Software License 2.0</license>
<author>Graham Christensen</author> <author url="http://iamgraham.net/">Graham Christensen</author>
<authorurl>http://iamgraham.net/</authorurl> <version>0.2</version>
<version>0.1</version> </pluggable>
</plugin>


0 comments on commit 5dc5561

Please sign in to comment.