Allow plugins to use fontawesome etc for icon

This commit is contained in:
Andrew Z
2019-01-01 15:42:16 -05:00
parent 2dd3615d89
commit 674ec1a925
5 changed files with 9 additions and 4 deletions

View File

@@ -65,14 +65,15 @@ foreach (glob($plugins,GLOB_NOSORT) as $plugin_link) {
//link/icon
$launch = plugin('launch',$plugin_file);
if ( $icon = plugin("icon",$plugin_file) ) {
if ( $launch )
$link = "<a href='/$launch'><i class='fa fa-$icon list'></i></a>";
$iconDisplay = substr($icon,0,5) == "icon-" ? "<i class='$icon list'></i>" : "<i class='fa fa-$icon list'></i>";
if ( $launch )
$link = "<a href='/$launch' class='list'>$iconDisplay</a>";
else
$link = "<i class='fa fa-$icon list'></i>";
$link = $iconDisplay;
} else {
$icon = icon($name);
if ( $launch )
$link = "<a href='/$launch'><img src='/$icon' class='list'></a>";
$link = "<a href='/$launch' class='list'><img src='/$icon' class='list'></a>";
else
$link = "<img src='/$icon' class='list'>";
}

View File

@@ -261,6 +261,7 @@ i.orb{font-size:1.1rem;margin:0 8px 0 3px}
img.icon{margin:-3px 4px 0 0}
img.list{width:auto;max-width:48px;height:48px}
i.list{font-size:4rem;}
a.list{text-decoration:none;}
div.content{position:absolute;top:0;left:0;width:100%;padding-bottom:30px;z-index:-1;clear:both}
div.content.shift{margin-top:1px}
label+.content{margin-top:64px}

View File

@@ -246,6 +246,7 @@ i.orb{font-size:1.1rem;margin:0 8px 0 3px}
img.icon{margin:-3px 4px 0 0}
img.list{width:auto;max-width:48px;height:48px}
i.list{font-size:4rem;}
a.list{text-decoration:none;}
div.content{position:absolute;top:0;left:0;width:100%;padding-bottom:30px;z-index:-1;clear:both}
div.content.shift{margin-top:1px}
label+.content{margin-top:86px}

View File

@@ -261,6 +261,7 @@ i.orb{font-size:1.1rem;margin:0 8px 0 3px}
img.icon{margin:-3px 4px 0 0}
img.list{width:auto;max-width:48px;height:48px}
i.list{font-size:4rem;}
a.list{text-decoration:none;}
div.content{position:absolute;top:0;left:0;width:100%;padding-bottom:30px;z-index:-1;clear:both}
div.content.shift{margin-top:1px}
label+.content{margin-top:64px}

View File

@@ -246,6 +246,7 @@ i.orb{font-size:1.1rem;margin:0 8px 0 3px}
img.icon{margin:-3px 4px 0 0}
img.list{width:auto;max-width:48px;height:48px}
i.list{font-size:4rem;}
a.list{text-decoration:none;}
div.content{position:absolute;top:0;left:0;width:100%;padding-bottom:30px;z-index:-1;clear:both}
div.content.shift{margin-top:1px}
label+.content{margin-top:86px}