diff options
author | zotlabs <mike@macgirvin.com> | 2017-01-13 13:22:36 -0800 |
---|---|---|
committer | zotlabs <mike@macgirvin.com> | 2017-01-13 13:22:36 -0800 |
commit | 4f1e4ffa70f5a822367eafec914ff8853561210d (patch) | |
tree | e9fb8dc76938729944071e4d1e6fb8dbdff10049 | |
parent | 7249eebc7528b2c60c1f83724966cc4a1192cbb0 (diff) | |
download | volse-hubzilla-4f1e4ffa70f5a822367eafec914ff8853561210d.tar.gz volse-hubzilla-4f1e4ffa70f5a822367eafec914ff8853561210d.tar.bz2 volse-hubzilla-4f1e4ffa70f5a822367eafec914ff8853561210d.zip |
several minor app nits
-rw-r--r-- | Zotlabs/Lib/Apps.php | 9 | ||||
-rw-r--r-- | Zotlabs/Module/Appman.php | 8 | ||||
-rw-r--r-- | Zotlabs/Module/Apps.php | 4 | ||||
-rw-r--r-- | include/widgets.php | 9 | ||||
-rw-r--r-- | view/pdl/mod_appman.pdl | 3 | ||||
-rw-r--r-- | view/tpl/app_create.tpl | 1 | ||||
-rw-r--r-- | view/tpl/app_select.tpl | 2 |
7 files changed, 23 insertions, 13 deletions
diff --git a/Zotlabs/Lib/Apps.php b/Zotlabs/Lib/Apps.php index 46486bb5a..358ae409b 100644 --- a/Zotlabs/Lib/Apps.php +++ b/Zotlabs/Lib/Apps.php @@ -100,15 +100,15 @@ class Apps { } $notfound = true; foreach(self::$installed_system_apps as $iapp) { - if($app['plugin'] && (! $iapp['app_plugin'])) - return(1); if($iapp['app_id'] == hash('whirlpool',$app['name'])) { $notfound = false; - if($iapp['app_version'] != $app['version']) { + if(($iapp['app_version'] != $app['version']) + || ($app['plugin'] && (! $iapp['app_plugin']))) { return intval($iapp['app_id']); } } } + return $notfound; } @@ -503,7 +503,7 @@ class Apps { static public function app_store($arr) { - // logger('app_store: ' . print_r($arr,true)); + //logger('app_store: ' . print_r($arr,true)); $darray = array(); $ret = array('success' => false); @@ -583,6 +583,7 @@ class Apps { static public function app_update($arr) { + //logger('app_update: ' . print_r($arr,true)); $darray = array(); $ret = array('success' => false); diff --git a/Zotlabs/Module/Appman.php b/Zotlabs/Module/Appman.php index 425b2d539..a7631758b 100644 --- a/Zotlabs/Module/Appman.php +++ b/Zotlabs/Module/Appman.php @@ -27,6 +27,7 @@ class Appman extends \Zotlabs\Web\Controller { 'price' => escape_tags($_REQUEST['price']), 'requires' => escape_tags($_REQUEST['requires']), 'system' => intval($_REQUEST['system']), + 'plugin' => escape_tags($_REQUEST['plugin']), 'sig' => escape_tags($_REQUEST['sig']), 'categories' => escape_tags($_REQUEST['categories']) ); @@ -57,13 +58,13 @@ class Appman extends \Zotlabs\Web\Controller { Zlib\Apps::app_destroy(local_channel(),$papp); } - if($_POST['edit']) { return; } - + if($_SESSION['return_url']) goaway(z_root() . '/' . $_SESSION['return_url']); + goaway(z_root() . '/apps'); @@ -76,7 +77,7 @@ class Appman extends \Zotlabs\Web\Controller { notice( t('Permission denied.') . EOL); return; } - + $channel = \App::get_channel(); $app = null; $embed = null; @@ -122,6 +123,7 @@ class Appman extends \Zotlabs\Web\Controller { '$price' => array('price', t('Price of app'),(($app) ? $app['app_price'] : ''), ''), '$page' => array('page', t('Location (URL) to purchase app'),(($app) ? $app['app_page'] : ''), ''), '$system' => (($app) ? intval($app['app_system']) : 0), + '$plugin' => (($app) ? $app['app_plugin'] : ''), '$requires' => (($app) ? $app['app_requires'] : ''), '$embed' => $embed, '$submit' => t('Submit') diff --git a/Zotlabs/Module/Apps.php b/Zotlabs/Module/Apps.php index 5583f1757..9186848df 100644 --- a/Zotlabs/Module/Apps.php +++ b/Zotlabs/Module/Apps.php @@ -12,8 +12,8 @@ class Apps extends \Zotlabs\Web\Controller { $mode = 'edit'; else $mode = 'list'; - - $_SESSION['return_url'] = \App::$cmd; + + $_SESSION['return_url'] = \App::$query_string; $apps = array(); diff --git a/include/widgets.php b/include/widgets.php index dde8e7cd0..d3bdb3313 100644 --- a/include/widgets.php +++ b/include/widgets.php @@ -104,7 +104,8 @@ function widget_appselect($arr) { '$authed' => ((local_channel()) ? true : false), '$personal' => t('Personal'), '$new' => t('New App'), - '$edit' => t('Edit App') + '$edit' => t('Edit Apps'), + '$cat' => ((array_key_exists('cat',$_REQUEST)) ? $_REQUEST['cat'] : '') )); } @@ -441,11 +442,13 @@ function widget_appcategories($arr) { if(! local_channel()) return ''; - $cat = ((x($_REQUEST,'cat')) ? htmlspecialchars($_REQUEST['cat'],ENT_COMPAT,'UTF-8') : ''); - $srchurl = App::$query_string; + $selected = ((x($_REQUEST,'cat')) ? htmlspecialchars($_REQUEST['cat'],ENT_COMPAT,'UTF-8') : ''); + $srchurl = rtrim(preg_replace('/cat\=[^\&].*?(\&|$)/is','',$srchurl),'&'); $srchurl = str_replace(array('?f=','&f='),array('',''),$srchurl); + $srchurl = z_root() . '/apps'; + $terms = array(); $r = q("select distinct(term.term) diff --git a/view/pdl/mod_appman.pdl b/view/pdl/mod_appman.pdl new file mode 100644 index 000000000..1209d85b9 --- /dev/null +++ b/view/pdl/mod_appman.pdl @@ -0,0 +1,3 @@ +[region=aside] +[widget=appcategories][/widget] +[/region] diff --git a/view/tpl/app_create.tpl b/view/tpl/app_create.tpl index 06fbcaaa7..32ab7fd4c 100644 --- a/view/tpl/app_create.tpl +++ b/view/tpl/app_create.tpl @@ -14,6 +14,7 @@ <input type="hidden" name="requires" value="{{$requires}}" /> <input type="hidden" name="system" value="{{$system}}" /> +<input type="hidden" name="plugin" value="{{$plugin}}" /> {{include file="field_input.tpl" field=$name}} diff --git a/view/tpl/app_select.tpl b/view/tpl/app_select.tpl index 93049d522..86ea0b1de 100644 --- a/view/tpl/app_select.tpl +++ b/view/tpl/app_select.tpl @@ -3,7 +3,7 @@ <h3>{{$title}}</h3> <ul class="nav nav-pills nav-stacked"> <li><a href="appman"><i class="fa fa-plus"></i> {{$new}}</a></li> -<li><a href="apps/edit"><i class="fa fa-pencil"></i> {{$edit}}</a></li> +<li><a href="apps/edit{{if $cat}}/?f=&cat={{$cat}}{{/if}}"><i class="fa fa-pencil"></i> {{$edit}}</a></li> </ul> </div> {{/if}} |