several minor app nits

This commit is contained in:
zotlabs 2017-01-13 13:22:36 -08:00
parent 7249eebc75
commit 4f1e4ffa70
7 changed files with 23 additions and 13 deletions

View File

@ -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);

View File

@ -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')

View File

@ -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();

View File

@ -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)

3
view/pdl/mod_appman.pdl Normal file
View File

@ -0,0 +1,3 @@
[region=aside]
[widget=appcategories][/widget]
[/region]

View File

@ -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}}

View File

@ -3,7 +3,7 @@
<h3>{{$title}}</h3>
<ul class="nav nav-pills nav-stacked">
<li><a href="appman"><i class="fa fa-plus"></i>&nbsp;&nbsp;{{$new}}</a></li>
<li><a href="apps/edit"><i class="fa fa-pencil"></i>&nbsp;&nbsp;{{$edit}}</a></li>
<li><a href="apps/edit{{if $cat}}/?f=&cat={{$cat}}{{/if}}"><i class="fa fa-pencil"></i>&nbsp;&nbsp;{{$edit}}</a></li>
</ul>
</div>
{{/if}}