Skip to content

Commit

Permalink
First upload Sharing Widget
Browse files Browse the repository at this point in the history
  • Loading branch information
libasys committed Dec 14, 2012
1 parent 1072498 commit 0f4f0f3
Show file tree
Hide file tree
Showing 66 changed files with 2,845 additions and 0 deletions.
23 changes: 23 additions & 0 deletions oc454/apps/files_sharing_widget/admin.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php

/**
* ownCloud - Picture Widget
*
* @author Sebastian Doell
* @copyright 2012 Sebastian Doell <sebastian.doell ad libasys dot de>
*
*
*/

OC_Util::checkAdminUser();
$shareSecret=OCP\Config::getSystemValue('secretword');
if($shareSecret=='') $shareSecret='mySecretWord';

$siteEmail=OCP\Config::getSystemValue('siteemail');
if($siteEmail=='') $siteEmail='';

$tmpl = new OCP\Template( 'files_sharing_widget', 'admin');
$tmpl->assign('secretword', $shareSecret);
$tmpl->assign('siteemail', $siteEmail);

return $tmpl->fetchPage();
18 changes: 18 additions & 0 deletions oc454/apps/files_sharing_widget/ajax/delshare.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php
/**
* ownCloud - Picture Widget
*
* @author Sebastian Doell
* @copyright 2012 Sebastian Doell <sebastian.doell ad libasys dot de>
*
*
*/


OCP\JSON::checkLoggedIn();
OCP\JSON::checkAppEnabled('files_sharing_widget');
OCP\JSON::callCheck();

$delId = isset($_POST["delid"])?$_POST["delid"]:'';
OC_Widget_Helper::delShare($delId);
OCP\JSON::success(array("data" => array( "msg" =>$delId)));
24 changes: 24 additions & 0 deletions oc454/apps/files_sharing_widget/ajax/saveparam.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php
/**
* ownCloud - Picture Widget
*
* @author Sebastian Doell
* @copyright 2012 Sebastian Doell <sebastian.doell ad libasys dot de>
*
*
*/


OCP\JSON::checkLoggedIn();
OCP\JSON::checkAppEnabled('files_sharing_widget');
OCP\JSON::callCheck();

$ObjSaveParamter['maxpicsperpage']=intval($_POST['sppics']);
$ObjSaveParamter['imgheight']=intval($_POST['spthumb']);
$ObjSaveParamter['width']=intval($_POST['spwidth']);
$ObjSaveParamter['height']=intval($_POST['spheight']);

$ObjSaveJson=json_encode($ObjSaveParamter);
OC_Preferences::setValue( OC_User::getUser(), 'files_sharing_widget', 'parameter', $ObjSaveJson);

OCP\JSON::success(array("data" => array( "msg" =>'success')));
27 changes: 27 additions & 0 deletions oc454/apps/files_sharing_widget/ajax/sendlink.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php

/**
* ownCloud - Picture Widget
*
* @author Sebastian Doell
* @copyright 2012 Sebastian Doell <sebastian.doell ad libasys dot de>
*
*
*/

OCP\JSON::checkLoggedIn();
OCP\JSON::checkAppEnabled('files_sharing_widget');
OCP\JSON::callCheck();

if( isset( $_POST['email'] ) && filter_var( $_POST['email'], FILTER_VALIDATE_EMAIL) ) {
$toMail=trim($_POST['email']);
$mailTxt = isset($_POST['mailtxt']) ? strip_tags(nl2br($_POST['mailtxt'])) : false;
$sharelink=$_POST['sharelink'];
//$from = '[email protected]';
$from=OCP\Config::getSystemValue('siteemail');
if($from=='') $from='';
//OC_MAIL::setFooter("\n--\n LibasysCloud - More than a Cloud!");
OC_MAIL::send($toMail, $toMail, 'Share Link by ' . OCP\USER::getUser(), $mailTxt."\n\nShared Link:\n".$sharelink, $from, 'ownCloud');

OCP\JSON::success(array("data" => array( "msg" =>'success')));
}
29 changes: 29 additions & 0 deletions oc454/apps/files_sharing_widget/ajax/sharesecret.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php

/**
* ownCloud - Picture Widget
*
* @author Sebastian Doell
* @copyright 2012 Sebastian Doell <sebastian.doell ad libasys dot de>
*
*
*/

OCP\JSON::checkLoggedIn();
OCP\JSON::checkAppEnabled('files_sharing_widget');
OCP\JSON::callCheck();

// Get data
if(isset( $_POST['mySecretWord'] ) && $_POST['mySecretWord'] != '') {
$secretWord=trim($_POST['mySecretWord']);
OCP\Config::setSystemValue('secretword', $secretWord);

OC_JSON::success(array("data" => array( "message" => 'Saved')));
}elseif(isset( $_POST['siteemail'] ) && filter_var( $_POST['siteemail'], FILTER_VALIDATE_EMAIL)) {
$siteEmail=trim($_POST['siteemail']);
OCP\Config::setSystemValue('siteemail', $siteEmail);
OC_JSON::success(array("data" => array( "message" => 'Saved')));
}
else{
OC_JSON::error(array("data" => array( "message" => 'Error' )));
}
15 changes: 15 additions & 0 deletions oc454/apps/files_sharing_widget/appinfo/app.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php
/**
* ownCloud - Picture Widget
*
* @author Sebastian Doell
* @copyright 2012 Sebastian Doell <sebastian.doell ad libasys dot de>
*
*
*/

OCP\App::registerPersonal('files_sharing_widget', 'settings');
OCP\App::registerAdmin('files_sharing_widget', 'admin');
OCP\Util::addscript( 'files_sharing_widget', 'settings');
OCP\Util::addscript( 'files_sharing_widget', 'admin');
OC::$CLASSPATH['OC_Widget_Helper'] = 'apps/files_sharing_widget/lib/widgethelper.php';
14 changes: 14 additions & 0 deletions oc454/apps/files_sharing_widget/appinfo/info.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0"?>
<info>
<id>files_sharing_widget</id>
<name>Share Gallery Widget</name>
<description>Picture Sharing Gallery Widget for use of implementing on a website or share by a Link</description>
<licence>AGPL</licence>
<author>S. Doell</author>
<require>4.9</require>
<shipped>true</shipped>
<default_enable/>
<types>
<filesystem/>
</types>
</info>
1 change: 1 addition & 0 deletions oc454/apps/files_sharing_widget/appinfo/version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.0 beta
9 changes: 9 additions & 0 deletions oc454/apps/files_sharing_widget/css/widget.css

Large diffs are not rendered by default.

Loading

0 comments on commit 0f4f0f3

Please sign in to comment.