parent
0a78849391
commit
fb88bdba69
@ -0,0 +1,25 @@ |
||||
<?php |
||||
|
||||
/** |
||||
* Copyright (c) 2011, Frank Karlitschek <karlitschek@kde.org> |
||||
* This file is licensed under the Affero General Public License version 3 or later. |
||||
* See the COPYING-README file. |
||||
*/ |
||||
|
||||
require_once('../../../lib/base.php'); |
||||
OC_Util::checkAdminUser(); |
||||
|
||||
$sites = array(); |
||||
for ($i = 0; $i < sizeof($_POST['site_name']); $i++) { |
||||
if (!empty($_POST['site_name'][$i]) && !empty($_POST['site_url'][$i])) { |
||||
array_push($sites, array($_POST['site_name'][$i], $_POST['site_url'][$i])); |
||||
} |
||||
} |
||||
|
||||
if (sizeof($sites) == 0) |
||||
OC_Appconfig::deleteKey('external', 'sites'); |
||||
else |
||||
OC_Appconfig::setValue('external', 'sites', json_encode($sites)); |
||||
|
||||
echo 'true'; |
||||
?> |
@ -1,24 +0,0 @@ |
||||
<?php |
||||
/** |
||||
* Copyright (c) 2011, Frank Karlitschek <karlitschek@kde.org> |
||||
* This file is licensed under the Affero General Public License version 3 or later. |
||||
* See the COPYING-README file. |
||||
*/ |
||||
|
||||
require_once('../../../lib/base.php'); |
||||
OC_Util::checkAdminUser(); |
||||
|
||||
if(isset($_POST['s1name'])) OC_Appconfig::setValue( 'external','site1name', $_POST['s1name'] ); |
||||
if(isset($_POST['s1url'])) OC_Appconfig::setValue( 'external','site1url', $_POST['s1url'] ); |
||||
if(isset($_POST['s2name'])) OC_Appconfig::setValue( 'external','site2name', $_POST['s2name'] ); |
||||
if(isset($_POST['s2url'])) OC_Appconfig::setValue( 'external','site2url', $_POST['s2url'] ); |
||||
if(isset($_POST['s3name'])) OC_Appconfig::setValue( 'external','site3name', $_POST['s3name'] ); |
||||
if(isset($_POST['s3url'])) OC_Appconfig::setValue( 'external','site3url', $_POST['s3url'] ); |
||||
if(isset($_POST['s4name'])) OC_Appconfig::setValue( 'external','site4name', $_POST['s4name'] ); |
||||
if(isset($_POST['s4url'])) OC_Appconfig::setValue( 'external','site4url', $_POST['s4url'] ); |
||||
if(isset($_POST['s5name'])) OC_Appconfig::setValue( 'external','site5name', $_POST['s5name'] ); |
||||
if(isset($_POST['s5url'])) OC_Appconfig::setValue( 'external','site5url', $_POST['s5url'] ); |
||||
|
||||
echo 'true'; |
||||
|
||||
?> |
@ -1,37 +1,35 @@ |
||||
<?php |
||||
|
||||
/** |
||||
* ownCloud - External plugin |
||||
* |
||||
* @author Frank Karlitschek |
||||
* @copyright 2011 Frank Karlitschek karlitschek@kde.org |
||||
* |
||||
* This library is free software; you can redistribute it and/or |
||||
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE |
||||
* License as published by the Free Software Foundation; either |
||||
* version 3 of the License, or any later version. |
||||
* |
||||
* This library is distributed in the hope that it will be useful, |
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
* GNU AFFERO GENERAL PUBLIC LICENSE for more details. |
||||
* |
||||
* You should have received a copy of the GNU Lesser General Public |
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>. |
||||
* |
||||
*/ |
||||
|
||||
OC_APP::registerAdmin('external','settings'); |
||||
|
||||
OC_App::register( array( 'order' => 70, 'id' => 'external', 'name' => 'External' )); |
||||
|
||||
if(OC_Appconfig::getValue( "external","site1name", '' )<>'') OC_App::addNavigationEntry( array( 'id' => 'external_index1', 'order' => 80, 'href' => OC_Helper::linkTo( 'external', 'index.php' ).'?id=1', 'icon' => OC_Helper::imagePath( 'external', 'external.png' ), 'name' => OC_Appconfig::getValue( "external","site1name", '' ))); |
||||
|
||||
if(OC_Appconfig::getValue( "external","site2name", '' )<>'') OC_App::addNavigationEntry( array( 'id' => 'external_index2', 'order' => 80, 'href' => OC_Helper::linkTo( 'external', 'index.php' ).'?id=2', 'icon' => OC_Helper::imagePath( 'external', 'external.png' ), 'name' => OC_Appconfig::getValue( "external","site2name", '' ))); |
||||
|
||||
if(OC_Appconfig::getValue( "external","site3name", '' )<>'') OC_App::addNavigationEntry( array( 'id' => 'external_index3', 'order' => 80, 'href' => OC_Helper::linkTo( 'external', 'index.php' ).'?id=3', 'icon' => OC_Helper::imagePath( 'external', 'external.png' ), 'name' => OC_Appconfig::getValue( "external","site3name", '' ))); |
||||
|
||||
if(OC_Appconfig::getValue( "external","site4name", '' )<>'') OC_App::addNavigationEntry( array( 'id' => 'external_index4', 'order' => 80, 'href' => OC_Helper::linkTo( 'external', 'index.php' ).'?id=4', 'icon' => OC_Helper::imagePath( 'external', 'external.png' ), 'name' => OC_Appconfig::getValue( "external","site4name", '' ))); |
||||
|
||||
if(OC_Appconfig::getValue( "external","site5name", '' )<>'') OC_App::addNavigationEntry( array( 'id' => 'external_index5', 'order' => 80, 'href' => OC_Helper::linkTo( 'external', 'index.php' ).'?id=5', 'icon' => OC_Helper::imagePath( 'external', 'external.png' ), 'name' => OC_Appconfig::getValue( "external","site5name", '' ))); |
||||
|
||||
* ownCloud - External plugin |
||||
* |
||||
* @author Frank Karlitschek |
||||
* @copyright 2011 Frank Karlitschek karlitschek@kde.org |
||||
* |
||||
* This library is free software; you can redistribute it and/or |
||||
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE |
||||
* License as published by the Free Software Foundation; either |
||||
* version 3 of the License, or any later version. |
||||
* |
||||
* This library is distributed in the hope that it will be useful, |
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
* GNU AFFERO GENERAL PUBLIC LICENSE for more details. |
||||
* |
||||
* You should have received a copy of the GNU Lesser General Public |
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>. |
||||
* |
||||
*/ |
||||
|
||||
OC::$CLASSPATH['OC_External'] = 'apps/external/lib/external.php'; |
||||
OC_Util::addStyle( 'external', 'style'); |
||||
|
||||
OC_APP::registerAdmin('external', 'settings'); |
||||
|
||||
OC_App::register(array('order' => 70, 'id' => 'external', 'name' => 'External')); |
||||
|
||||
$sites = OC_External::getSites(); |
||||
for ($i = 0; $i < sizeof($sites); $i++) { |
||||
OC_App::addNavigationEntry( |
||||
array('id' => 'external_index' . ($i + 1), 'order' => 80 + $i, 'href' => OC_Helper::linkTo('external', 'index.php') . '?id=' . ($i + 1), 'icon' => OC_Helper::imagePath('external', 'external.png'), 'name' => $sites[$i][0])); |
||||
} |
@ -0,0 +1,14 @@ |
||||
/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- / |
||||
/* vim: set shiftwidth=4 tabstop=8 autoindent cindent expandtab: */ |
||||
|
||||
.site_url { |
||||
width: 250px; |
||||
} |
||||
|
||||
.delete_button { |
||||
display: none; |
||||
} |
||||
|
||||
.external_sites { |
||||
width: 450px; |
||||
} |
@ -1,42 +1,43 @@ |
||||
<?php |
||||
|
||||
/** |
||||
* ownCloud - External plugin |
||||
* |
||||
* @author Frank Karlitschek |
||||
* @copyright 2011 Frank Karlitschek karlitschek@kde.org |
||||
* |
||||
* This library is free software; you can redistribute it and/or |
||||
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE |
||||
* License as published by the Free Software Foundation; either |
||||
* version 3 of the License, or any later version. |
||||
* |
||||
* This library is distributed in the hope that it will be useful, |
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
* GNU AFFERO GENERAL PUBLIC LICENSE for more details. |
||||
* |
||||
* You should have received a copy of the GNU Lesser General Public |
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>. |
||||
* |
||||
*/ |
||||
|
||||
* ownCloud - External plugin |
||||
* |
||||
* @author Frank Karlitschek |
||||
* @copyright 2011 Frank Karlitschek karlitschek@kde.org |
||||
* |
||||
* This library is free software; you can redistribute it and/or |
||||
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE |
||||
* License as published by the Free Software Foundation; either |
||||
* version 3 of the License, or any later version. |
||||
* |
||||
* This library is distributed in the hope that it will be useful, |
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
* GNU AFFERO GENERAL PUBLIC LICENSE for more details. |
||||
* |
||||
* You should have received a copy of the GNU Lesser General Public |
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>. |
||||
* |
||||
*/ |
||||
require_once('../../lib/base.php'); |
||||
require_once('lib/external.php'); |
||||
|
||||
OC_Util::checkLoggedIn(); |
||||
|
||||
if(isset($_GET['id'])){ |
||||
if (isset($_GET['id'])) { |
||||
|
||||
$id=$_GET['id']; |
||||
$id = $_GET['id']; |
||||
$id = (int) $id; |
||||
|
||||
$url=OC_Appconfig::getValue( "external","site".$id."url", '' ); |
||||
OC_App::setActiveNavigationEntry( 'external_index'.$id ); |
||||
|
||||
$tmpl = new OC_Template( 'external', 'frame', 'user' ); |
||||
$tmpl->assign('url',$url); |
||||
$tmpl->printPage(); |
||||
$sites = OC_External::getSites(); |
||||
if (sizeof($sites) >= $id) { |
||||
$url = $sites[$id - 1][1]; |
||||
OC_App::setActiveNavigationEntry('external_index' . $id); |
||||
|
||||
$tmpl = new OC_Template('external', 'frame', 'user'); |
||||
$tmpl->assign('url', $url); |
||||
$tmpl->printPage(); |
||||
} |
||||
} |
||||
|
||||
?> |
||||
|
@ -0,0 +1,36 @@ |
||||
<?php |
||||
|
||||
/** |
||||
* ownCloud - gallery application |
||||
* |
||||
* @author Bartek Przybylski |
||||
* @copyright 2012 Bartek Przybylski bart.p.pl@gmail.com |
||||
* |
||||
* This library is free software; you can redistribute it and/or |
||||
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE |
||||
* License as published by the Free Software Foundation; either |
||||
* version 3 of the License, or any later version. |
||||
* |
||||
* This library is distributed in the hope that it will be useful, |
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
* GNU AFFERO GENERAL PUBLIC LICENSE for more details. |
||||
* |
||||
* You should have received a copy of the GNU Lesser General Public |
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>. |
||||
* |
||||
*/ |
||||
|
||||
class OC_External { |
||||
|
||||
public static function getSites() { |
||||
if (($sites = json_decode(OC_Appconfig::getValue("external", "sites", ''))) != NULL) { |
||||
return $sites; |
||||
} |
||||
|
||||
return array(); |
||||
} |
||||
|
||||
} |
||||
|
||||
?> |
@ -1,23 +1,21 @@ |
||||
<form id="external"> |
||||
<fieldset class="personalblock"> |
||||
<strong>External Sites</strong><br /> |
||||
<input type="text" name="s1name" id="s1name" value="<?php echo $_['s1name']; ?>" placeholder="<?php echo $l->t('Name');?>" />
|
||||
<input type="text" name="s1url" id="s1url" value="<?php echo $_['s1url']; ?>" placeholder="<?php echo $l->t('Url');?>" />
|
||||
<br /> |
||||
<input type="text" name="s2name" id="s2name" value="<?php echo $_['s2name']; ?>" placeholder="<?php echo $l->t('Name');?>" />
|
||||
<input type="text" name="s2url" id="s2url" value="<?php echo $_['s2url']; ?>" placeholder="<?php echo $l->t('Url');?>" />
|
||||
<br /> |
||||
<input type="text" name="s3name" id="s3name" value="<?php echo $_['s3name']; ?>" placeholder="<?php echo $l->t('Name');?>" />
|
||||
<input type="text" name="s3url" id="s3url" value="<?php echo $_['s3url']; ?>" placeholder="<?php echo $l->t('Url');?>" />
|
||||
<br /> |
||||
<input type="text" name="s4name" id="s4name" value="<?php echo $_['s4name']; ?>" placeholder="<?php echo $l->t('Name');?>" />
|
||||
<input type="text" name="s4url" id="s4url" value="<?php echo $_['s4url']; ?>" placeholder="<?php echo $l->t('Url');?>" />
|
||||
<br /> |
||||
<input type="text" name="s5name" id="s5name" value="<?php echo $_['s5name']; ?>" placeholder="<?php echo $l->t('Name');?>" />
|
||||
<input type="text" name="s5url" id="s5url" value="<?php echo $_['s5url']; ?>" placeholder="<?php echo $l->t('Url');?>" />
|
||||
<br /> |
||||
<ul class="external_sites"> |
||||
|
||||
<?php |
||||
$sites = OC_External::getSites(); |
||||
for($i = 0; $i < sizeof($sites); $i++) { |
||||
echo '<li><input type="text" name="site_name[]" class="site_name" value="'.$sites[$i][0].'" placeholder="'.$l->t('Name').'" /> |
||||
<input type="text" class="site_url" name="site_url[]" value="'.$sites[$i][1].'" placeholder="'.$l->t('URL').'" /> |
||||
<img class="svg action delete_button" src="'.image_path("", "actions/delete.svg") .'" title="'.$l->t("Remove site").'" /> |
||||
</li>'; |
||||
} |
||||
?> |
||||
|
||||
<span class="msg"></span> |
||||
</ul> |
||||
|
||||
<input type="button" id="add_external_site" value="Add" /> |
||||
<span class="msg"></span> |
||||
</fieldset> |
||||
</form> |
||||
|
Loading…
Reference in new issue