Skip to content

Commit

Permalink
awesome tag cloud script with admin option to enable
Browse files Browse the repository at this point in the history
  • Loading branch information
Phil Bayfield committed Jul 17, 2015
1 parent 47325e1 commit 9c062a8
Show file tree
Hide file tree
Showing 10 changed files with 1,137 additions and 5 deletions.
4 changes: 4 additions & 0 deletions admin/css/admin.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#configContent fieldset.mainConf label.radio {
display: inline-block;
width: 120px;
}
8 changes: 8 additions & 0 deletions admin/less/admin.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#configContent {
fieldset.mainConf {
label.radio {
display: inline-block;
width: 120px;
}
}
}
1 change: 1 addition & 0 deletions admin/template/about.tpl
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{combine_css path="themes/bootstrapdefault/admin/css/admin.css"}
<div class="titrePage">
<h2>{'Bootstrap Default'|@translate} {$TABSHEET_TITLE}</h2>
</div>
Expand Down
1 change: 1 addition & 0 deletions admin/template/changelog.tpl
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{combine_css path="themes/bootstrapdefault/admin/css/admin.css"}
<div class="titrePage">
<h2>{'Bootstrap Default'|@translate} {$TABSHEET_TITLE}</h2>
</div>
Expand Down
26 changes: 22 additions & 4 deletions admin/template/settings.tpl
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{combine_css path="themes/bootstrapdefault/admin/css/admin.css"}
{combine_script id='common' load='footer' path='admin/themes/default/js/common.js'}
<div class="titrePage">
<h2>{'Bootstrap Default'|@translate} {$TABSHEET_TITLE}</h2>
Expand All @@ -6,7 +7,7 @@
<input type="hidden" name="boostrapdefault_settings" value="true" />
<div id="configContent">
<fieldset class="mainConf">
<legend>Social integration</legend>
<legend>{'Social integration'|@translate}</legend>
<ul>
<li>
<label class="font-checkbox">
Expand Down Expand Up @@ -41,14 +42,14 @@
</div>
<div id="configContent">
<fieldset class="mainConf">
<legend>Comments</legend>
<legend>{'Comments'|@translate}</legend>
<ul>
<li>
<label>
<label class="radio">
<input type="radio" name="comments_type" value="piwigo"{if $theme_config->comments_type == 'piwigo'} checked="checked"{/if} />
{'Piwigo'|@translate}
</label>
<label>
<label class="radio">
<input id="comments_radio_disqus" type="radio" name="comments_type" value="disqus"{if $theme_config->comments_type == 'disqus'} checked="checked"{/if} />
{'Disqus'|@translate}
</label>
Expand All @@ -60,6 +61,23 @@
</ul>
</fieldset>
</div>
<div id="configContent">
<fieldset class="mainConf">
<legend>{'Tag cloud'|@translate}</legend>
<ul>
<li>
<label class="radio">
<input type="radio" name="tag_cloud_type" value="basic"{if $theme_config->tag_cloud_type == 'basic'} checked="checked"{/if} />
{'Basic'|@translate}
</label>
<label class="radio">
<input type="radio" name="tag_cloud_type" value="html5"{if $theme_config->tag_cloud_type == 'html5'} checked="checked"{/if} />
{'HTML 5 canvas'|@translate}
</label>
</li>
</ul>
</fieldset>
</div>
<p class="formButtons">
<input type="submit" name="submit" value="Save settings">
</p>
Expand Down
6 changes: 5 additions & 1 deletion include/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
class Config {

const CONF_PARAM = 'bootstrapdefault';
const CONF_VERSION = 1;
const CONF_VERSION = 2;

const TYPE_BOOL = 'bool';
const TYPE_STRING = 'string';
Expand All @@ -19,13 +19,16 @@ class Config {
const KEY_COMMENTS_TYPE = 'comments_type';
const KEY_COMMENTS_DISQUS_SHORTNAME = 'comments_disqus_shortname';

const KEY_TAG_CLOUD_TYPE = 'tag_cloud_type';

private $defaults = array(
self::KEY_SOCIAL_ENABLED => true,
self::KEY_SOCIAL_TWITTER => true,
self::KEY_SOCIAL_FACEBOOK => true,
self::KEY_SOCIAL_GOOGLE_PLUS => true,
self::KEY_COMMENTS_TYPE => 'piwigo',
self::KEY_COMMENTS_DISQUS_SHORTNAME => null,
self::KEY_TAG_CLOUD_TYPE => 'basic',
);

private $types = array(
Expand All @@ -35,6 +38,7 @@ class Config {
self::KEY_SOCIAL_GOOGLE_PLUS => self::TYPE_BOOL,
self::KEY_COMMENTS_TYPE => self::TYPE_STRING,
self::KEY_COMMENTS_DISQUS_SHORTNAME => self::TYPE_STRING,
self::KEY_TAG_CLOUD_TYPE => self::TYPE_STRING,
);

private $config = array();
Expand Down
Loading

0 comments on commit 9c062a8

Please sign in to comment.