move apps to zlib

This commit is contained in:
redmatrix
2016-05-22 19:25:27 -07:00
parent 5e0698ba87
commit 2d06663490
4 changed files with 20 additions and 677 deletions

View File

@@ -2,8 +2,9 @@
namespace Zotlabs\Module;
require_once('include/apps.php');
//require_once('include/apps.php');
use \Zotlabs\Lib as Zlib;
class Appman extends \Zotlabs\Web\Controller {
@@ -30,16 +31,16 @@ class Appman extends \Zotlabs\Web\Controller {
'categories' => escape_tags($_REQUEST['categories'])
);
$_REQUEST['appid'] = app_install(local_channel(),$arr);
$_REQUEST['appid'] = Zlib\Apps::app_install(local_channel(),$arr);
if(app_installed(local_channel(),$arr))
if(Zlib\Apps::app_installed(local_channel(),$arr))
info( t('App installed.') . EOL);
return;
}
$papp = app_decode($_POST['papp']);
$papp = Zlib\Apps::app_decode($_POST['papp']);
if(! is_array($papp)) {
notice( t('Malformed app.') . EOL);
@@ -47,13 +48,13 @@ class Appman extends \Zotlabs\Web\Controller {
}
if($_POST['install']) {
app_install(local_channel(),$papp);
if(app_installed(local_channel(),$papp))
Zlib\Apps::app_install(local_channel(),$papp);
if(Zlib\Apps::app_installed(local_channel(),$papp))
info( t('App installed.') . EOL);
}
if($_POST['delete']) {
app_destroy(local_channel(),$papp);
Zlib\Apps::app_destroy(local_channel(),$papp);
}
if($_POST['edit']) {
@@ -100,7 +101,7 @@ class Appman extends \Zotlabs\Web\Controller {
}
}
$embed = array('embed', t('Embed code'), app_encode($app,true),'', 'onclick="this.select();"');
$embed = array('embed', t('Embed code'), Zlib\Apps::app_encode($app,true),'', 'onclick="this.select();"');
}

View File

@@ -1,8 +1,9 @@
<?php
namespace Zotlabs\Module;
require_once('include/apps.php');
//require_once('include/apps.php');
use \Zotlabs\Lib as Zlib;
class Apps extends \Zotlabs\Web\Controller {
@@ -19,25 +20,25 @@ class Apps extends \Zotlabs\Web\Controller {
if(local_channel()) {
import_system_apps();
Zlib\Apps::import_system_apps();
$syslist = array();
$list = app_list(local_channel(), false, $_GET['cat']);
$list = Zlib\Apps::app_list(local_channel(), false, $_GET['cat']);
if($list) {
foreach($list as $x) {
$syslist[] = app_encode($x);
$syslist[] = Zlib\Apps::app_encode($x);
}
}
translate_system_apps($syslist);
Zlib\Apps::translate_system_apps($syslist);
}
else
$syslist = get_system_apps(true);
$syslist = Zlib\Apps::get_system_apps(true);
usort($syslist,'app_name_compare');
usort($syslist,'Zlib\\Apps::app_name_compare');
// logger('apps: ' . print_r($syslist,true));
foreach($syslist as $app) {
$apps[] = app_render($app,$mode);
$apps[] = Zlib\Apps::app_render($app,$mode);
}
return replace_macros(get_markup_template('myapps.tpl'), array(