]> source.dussan.org Git - nextcloud-server.git/commitdiff
improve the app installer.
authorFrank Karlitschek <karlitschek@kde.org>
Sat, 21 Apr 2012 13:30:58 +0000 (15:30 +0200)
committerFrank Karlitschek <karlitschek@kde.org>
Sat, 21 Apr 2012 13:30:58 +0000 (15:30 +0200)
show a label if an app is an internal app or a third party app from the app store.
show a preview image of the app if available

lib/ocsclient.php
settings/apps.php
settings/css/settings.css
settings/js/apps.js
settings/templates/apps.php
settings/trans.png [new file with mode: 0644]

index 9ad9ef21c665ded2dd85d75077f259b81ee7bdc1..aef51f38fb7f33e129f397d0634aff029f57e759 100755 (executable)
@@ -162,6 +162,7 @@ class OC_OCSClient{
                $app['preview3']=$tmp->smallpreviewpic3;
                $app['changed']=strtotime($tmp->changed);
                $app['description']=$tmp->description;
+               $app['detailpage']=$tmp->detailpage;
 
                return $app;
        }
index 0889b0c45ed720a9b3953f48169f54ec35d21fe0..cc161026020b0a66f429a750eb794c41ac8f0b1a 100644 (file)
@@ -39,6 +39,9 @@ foreach($registeredApps as $app){
                $info=OC_App::getAppInfo($app);
                $active=(OC_Appconfig::getValue($app,'enabled','no')=='yes')?true:false;
                $info['active']=$active;
+               $info['internal']=true;
+               $info['internallabel']='Internal App';
+               $info['preview']='trans.png';
                $apps[]=$info;
        }
 }
@@ -64,6 +67,7 @@ usort($apps, 'app_sort');
                }
 
                if(!$local) {
+                       if($app['preview']=='') $pre='trans.png'; else $pre=$app['preview'];
                        $apps[]=array(
                                'name'=>$app['name'],
                                'id'=>$app['id'],
@@ -71,6 +75,9 @@ usort($apps, 'app_sort');
                                'description'=>$app['description'],
                                'author'=>$app['personid'],
                                'license'=>$app['license'],
+                               'preview'=>$pre,
+                               'internal'=>false,
+                               'internallabel'=>'3rd Party App',
                        );
                }
        }
index 42576953d042c382888f00914af93118a25588d7..62e84654d5553c72ab20991aafe77c53509aab6a 100644 (file)
@@ -40,7 +40,8 @@ select.quota.active { background: #fff; }
 /* APPS */
 li { color:#888; }
 li.active { color:#000; }
+small.externalapp { color:#FFF; background-color:#BBB; font-weight:bold; font-size:6pt; padding:4px; border-radius: 4px;}
 span.version { margin-left:3em; color:#ddd; }
 
 /* LOF */
-#log { white-space:normal; }
\ No newline at end of file
+#log { white-space:normal; }
index 12d09ac69db564513bb5157b1c7f65b8b7f80de7..df5300911aa388ffc404165644d0fe196f44f6c4 100644 (file)
@@ -13,8 +13,11 @@ $(document).ready(function(){
                var app=$(this).data('app');
                $('#rightcontent p').show();
                $('#rightcontent span.name').text(app.name);
+               $('#rightcontent small.externalapp').text(app.internallabel);
                $('#rightcontent span.version').text(app.version);
                $('#rightcontent p.description').text(app.description);
+               $('#rightcontent img.preview').attr('src',app.preview);
+               $('#rightcontent small.externalapp').attr('style','visibility:visible');
                $('#rightcontent span.author').text(app.author);
                $('#rightcontent span.licence').text(app.licence);
                
index 1e49b4c89288425000c7df4970a75247f30ca1ac..d25ca1bc7fb881f291288643a46b7df9a194f52a 100644 (file)
@@ -5,7 +5,7 @@
  */?>
 
 <div id="controls">
-       <a class="button" target="_blank" href="http://owncloud.org/dev/writing-apps/"><?php echo $l->t('Add your application');?></a>
+       <a class="button" target="_blank" href="http://owncloud.org/dev/writing-apps/"><?php echo $l->t('Add your App');?></a>
 </div>
 <ul id="leftcontent">
        <?php foreach($_['apps'] as $app):?>
                <span class="hidden">
                        <?php OC_JSON::encodedPrint($app,false) ?>
                </span>
+               <?php  if(!$app['internal']) echo '<small class="externalapp">3rd party</small>' ?>
        </li>
        <?php endforeach;?>
 </ul>
 <div id="rightcontent">
-       <h3><strong><span class="name"><?php echo $l->t('Select an App');?></span></strong><span class="version"></span></h3>
+       <h3><strong><span class="name"><?php echo $l->t('Select an App');?></span></strong><span class="version"></span><small class="externalapp" style="visibility:hidden;"></small></h3>
        <p class="description"></p>
+       <img src="" class="preview" />
        <p class="hidden"><span class="licence"></span><?php echo $l->t('-licensed');?> <?php echo $l->t('by');?> <span class="author"></span></p>
        <input class="enable hidden" type="submit" />
 </div>
diff --git a/settings/trans.png b/settings/trans.png
new file mode 100644 (file)
index 0000000..e692016
Binary files /dev/null and b/settings/trans.png differ