aboutsummaryrefslogtreecommitdiffstats
path: root/addon/widgets/widgets.php
diff options
context:
space:
mode:
authorfabrixxm <fabrix.xm@gmail.com>2011-07-05 07:11:57 +0200
committerfabrixxm <fabrix.xm@gmail.com>2011-07-05 07:11:57 +0200
commit4e7a5dc56ebb8d99ed06b0b303c4ee24460ae6a8 (patch)
tree84184bd3aa80c896b8dceaf5a017297c7267f2cb /addon/widgets/widgets.php
parentcfd59f6ac8848c19a0c451c378d2b770cafcbef0 (diff)
parent2359783b9f6c0ec754c641453026712cf22e7cb6 (diff)
downloadvolse-hubzilla-4e7a5dc56ebb8d99ed06b0b303c4ee24460ae6a8.tar.gz
volse-hubzilla-4e7a5dc56ebb8d99ed06b0b303c4ee24460ae6a8.tar.bz2
volse-hubzilla-4e7a5dc56ebb8d99ed06b0b303c4ee24460ae6a8.zip
Merge branch 'dispy' of github.com:fabrixxm/friendika into dispy
Diffstat (limited to 'addon/widgets/widgets.php')
-rw-r--r--addon/widgets/widgets.php36
1 files changed, 17 insertions, 19 deletions
diff --git a/addon/widgets/widgets.php b/addon/widgets/widgets.php
index f5f868222..13c4f93bb 100644
--- a/addon/widgets/widgets.php
+++ b/addon/widgets/widgets.php
@@ -33,34 +33,32 @@ function widgets_settings(&$a,&$o) {
$key = get_pconfig(local_user(), 'widgets', 'key' );
if ($key=='') { $key = mt_rand(); set_pconfig(local_user(), 'widgets', 'key', $key); }
-
- $o .='<h3 class="settings-heading">Widgets</h3>';
-
-
- $o.='
- <div id="settings-username-wrapper">
- '. t('Widgets key: ') .'<strong>'.$key.'</strong>
- </div>
- <div id="settings-username-end"></div>
- <div class="settings-submit-wrapper">
- <input type="submit" value="'.t('Generate new key').'" class="settings-submit" name="widgets-submit">
- </div>';
-
-
- $o.='<h4>Widgets:</h4>';
- $o .= '<ul>';
+
+ $widgets = array();
$d = dir(dirname(__file__));
while(false !== ($f = $d->read())) {
if(substr($f,0,7)=="widget_") {
preg_match("|widget_([^.]+).php|", $f, $m);
$w=$m[1];
require_once($f);
- $o.='<li><a href="'.$a->get_baseurl().'/widgets/'.$w.'/?k='.$key.'&p=1">'. call_user_func($w."_widget_name") .'</a></li>';
+ $widgets[] = array($w, call_user_func($w."_widget_name"));
+
}
}
- $o .= '</ul>';
-
+
+
+ $t = file_get_contents( dirname(__file__). "/settings.tpl" );
+ $o .= replace_macros($t, array(
+ '$submit' => t('Generate new key'),
+ '$baseurl' => $a->get_baseurl(),
+ '$title' => "Widgets",
+ '$label' => t('Widgets key'),
+ '$key' => $key,
+ '$widgets_h' => t('Widgets available'),
+ '$widgets' => $widgets,
+ ));
+
}
function widgets_module() {