more app work
This commit is contained in:
parent
e9b006a5eb
commit
751fda9704
@ -104,7 +104,15 @@ function parse_app_description($f) {
|
|||||||
|
|
||||||
|
|
||||||
function translate_system_apps(&$arr) {
|
function translate_system_apps(&$arr) {
|
||||||
$apps = array( 'Matrix' => t('Matrix'),
|
$apps = array(
|
||||||
|
'Bookmarks' => t('Bookmarks'),
|
||||||
|
'Address Book' => t('Address Book'),
|
||||||
|
'Login' => t('Login'),
|
||||||
|
'Channel Select' => t('Channel Select'),
|
||||||
|
'Matrix' => t('Matrix'),
|
||||||
|
'Settings' => t('Settings'),
|
||||||
|
'Files' => t('Files'),
|
||||||
|
'Webpages' => t('Webpages'),
|
||||||
'Channel Home' => t('Channel Home'),
|
'Channel Home' => t('Channel Home'),
|
||||||
'Profile' => t('Profile'),
|
'Profile' => t('Profile'),
|
||||||
'Photos' => t('Photos'),
|
'Photos' => t('Photos'),
|
||||||
@ -142,6 +150,9 @@ function app_render($papp,$mode = 'view') {
|
|||||||
foreach($papp as $k => $v) {
|
foreach($papp as $k => $v) {
|
||||||
if(strpos($v,'http') === 0 && $k != 'papp')
|
if(strpos($v,'http') === 0 && $k != 'papp')
|
||||||
$papp[$k] = zid($v);
|
$papp[$k] = zid($v);
|
||||||
|
if($k === 'desc')
|
||||||
|
$papp['desc'] = str_replace(array('\'','"'),array(''','&dquot;'),$papp['desc']);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(local_user()) {
|
if(local_user()) {
|
||||||
@ -152,7 +163,9 @@ function app_render($papp,$mode = 'view') {
|
|||||||
|
|
||||||
return replace_macros(get_markup_template('app.tpl'),array(
|
return replace_macros(get_markup_template('app.tpl'),array(
|
||||||
'$app' => $papp,
|
'$app' => $papp,
|
||||||
|
'$purchase' => (($papp['page'] && (! $installed)) ? t('Purchase') : ''),
|
||||||
'$install' => ((local_user() && $mode == 'view') ? $install_action : ''),
|
'$install' => ((local_user() && $mode == 'view') ? $install_action : ''),
|
||||||
|
'$edit' => ((local_user() && $installed && $mode == 'edit') ? t('Edit') : ''),
|
||||||
'$delete' => ((local_user() && $installed && $mode == 'edit') ? t('Delete') : '')
|
'$delete' => ((local_user() && $installed && $mode == 'edit') ? t('Delete') : '')
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
@ -348,8 +361,8 @@ function app_encode($app,$embed = false) {
|
|||||||
if($app['app_page'])
|
if($app['app_page'])
|
||||||
$ret['page'] = $app['app_page'];
|
$ret['page'] = $app['app_page'];
|
||||||
|
|
||||||
if($app['alt_url'])
|
// if($app['alt_url'])
|
||||||
$ret['alt_url'] = $app['alt_url'];
|
// $ret['alt_url'] = $app['alt_url'];
|
||||||
|
|
||||||
if(! $embed)
|
if(! $embed)
|
||||||
return $ret;
|
return $ret;
|
||||||
|
@ -76,11 +76,11 @@ function widget_collections($args) {
|
|||||||
|
|
||||||
function widget_appselect($arr) {
|
function widget_appselect($arr) {
|
||||||
return replace_macros(get_markup_template('app_select.tpl'),array(
|
return replace_macros(get_markup_template('app_select.tpl'),array(
|
||||||
'$title' => t('App Category'),
|
'$title' => t('Apps'),
|
||||||
'$system' => t('System'),
|
'$system' => t('System'),
|
||||||
'$personal' => t('Personal')
|
'$personal' => t('Personal'),
|
||||||
// '$featured' => t('Featured'),
|
'$new' => t('Create Personal App'),
|
||||||
// '$new' => t('New')
|
'$edit' => t('Edit Personal App')
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -44,6 +44,10 @@ function appman_post(&$a) {
|
|||||||
app_destroy(local_user(),$papp);
|
app_destroy(local_user(),$papp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($_POST['edit']) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if($_SESSION['return_url'])
|
if($_SESSION['return_url'])
|
||||||
goaway(z_root() . '/' . $_SESSION['return_url']);
|
goaway(z_root() . '/' . $_SESSION['return_url']);
|
||||||
goaway(z_root() . '/apps/personal');
|
goaway(z_root() . '/apps/personal');
|
||||||
@ -58,7 +62,7 @@ function appman_content(&$a) {
|
|||||||
notice( t('Permission denied.') . EOL);
|
notice( t('Permission denied.') . EOL);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
logger('content');
|
||||||
$channel = $a->get_channel();
|
$channel = $a->get_channel();
|
||||||
$app = null;
|
$app = null;
|
||||||
$embed = null;
|
$embed = null;
|
||||||
@ -75,7 +79,7 @@ function appman_content(&$a) {
|
|||||||
|
|
||||||
return replace_macros(get_markup_template('app_create.tpl'), array(
|
return replace_macros(get_markup_template('app_create.tpl'), array(
|
||||||
|
|
||||||
'$banner' => t('Create App'),
|
'$banner' => (($app) ? t('Edit App') : t('Create App')),
|
||||||
'$app' => $app,
|
'$app' => $app,
|
||||||
'$guid' => (($app) ? $app['app_id'] : ''),
|
'$guid' => (($app) ? $app['app_id'] : ''),
|
||||||
'$author' => (($app) ? $app['app_author'] : $channel['channel_hash']),
|
'$author' => (($app) ? $app['app_author'] : $channel['channel_hash']),
|
||||||
|
@ -28,8 +28,6 @@ function apps_content(&$a) {
|
|||||||
$list = app_list(local_user());
|
$list = app_list(local_user());
|
||||||
if($list) {
|
if($list) {
|
||||||
foreach($list as $app) {
|
foreach($list as $app) {
|
||||||
if($mode == 'edit')
|
|
||||||
$app['alt_url'] = z_root() . '/appman/?f=&appid=' . $app['app_id'];
|
|
||||||
$apps[] = app_render(app_encode($app),$mode);
|
$apps[] = app_render(app_encode($app),$mode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,11 +1,15 @@
|
|||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<a href="{{if $app.alt_url}}{{$app.alt_url}}{{else}}{{$app.url}}{{/if}}" {{if $app.hover}}title="{{$app.hover}}"{{/if}}><img src="{{$app.photo}}" width="80" height="80" />
|
<a href="{{if $app.alt_url}}{{$app.alt_url}}{{else}}{{$app.url}}{{/if}}" {{if $app.desc}}title="{{$app.desc}}{{if $app.price}} ({{$app.price}}){{/if}}"{{/if}}><img src="{{$app.photo}}" width="80" height="80" />
|
||||||
<div class="app-name">{{$app.name}}</div>
|
<div class="app-name">{{$app.name}}</div>
|
||||||
</a>
|
</a>
|
||||||
|
{{if $purchase}}
|
||||||
|
<a href="{{$app.page}}" class="btn btn-default" title="{{$purchase}}" ><i class="icon-external"></i></a>
|
||||||
|
{{/if}}
|
||||||
{{if $install || $update || $delete }}
|
{{if $install || $update || $delete }}
|
||||||
<form action="appman" method="post">
|
<form action="appman" method="post">
|
||||||
<input type="hidden" name="papp" value="{{$app.papp}}" />
|
<input type="hidden" name="papp" value="{{$app.papp}}" />
|
||||||
{{if $install}}<button type="submit" name="install" value="{{$install}}" class="btn btn-default" title="{{$install}}" ><i class="icon-download-alt" ></i></button>{{/if}}
|
{{if $install}}<button type="submit" name="install" value="{{$install}}" class="btn btn-default" title="{{$install}}" ><i class="icon-download-alt" ></i></button>{{/if}}
|
||||||
|
{{if $edit}}<input type="hidden" name="appid" value="{{$app.guid}}" /><button type="submit" name="edit" value="{{$edit}}" class="btn btn-default" title="{{$edit}}" ><i class="icon-pencil" ></i></button>{{/if}}
|
||||||
{{if $delete}}<button type="submit" name="delete" value="{{$delete}}" class="btn btn-default" title="{{$delete}}" ><i class="icon-remove drop-icons"></i></button>{{/if}}
|
{{if $delete}}<button type="submit" name="delete" value="{{$delete}}" class="btn btn-default" title="{{$delete}}" ><i class="icon-remove drop-icons"></i></button>{{/if}}
|
||||||
</form>
|
</form>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
@ -3,6 +3,9 @@
|
|||||||
<ul>
|
<ul>
|
||||||
<li><a href="apps">{{$system}}</a></li>
|
<li><a href="apps">{{$system}}</a></li>
|
||||||
<li><a href="apps/personal">{{$personal}}</a></li>
|
<li><a href="apps/personal">{{$personal}}</a></li>
|
||||||
|
<br />
|
||||||
|
<li><a href="appman">{{$new}}</a></li>
|
||||||
|
<li><a href="apps/personal/edit">{{$edit}}</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user