Skip to content

Commit

Permalink
Update 0.9.1.1
Browse files Browse the repository at this point in the history
Nextcloud Approvement requirements.
  • Loading branch information
Patt92 committed Mar 6, 2017
1 parent fc3b932 commit 732cc27
Show file tree
Hide file tree
Showing 46 changed files with 69 additions and 69 deletions.
19 changes: 0 additions & 19 deletions files_w2g/appinfo/routes.php

This file was deleted.

1 change: 0 additions & 1 deletion files_w2g/appinfo/version

This file was deleted.

2 changes: 1 addition & 1 deletion files_w2g/admin.php → workin2gether/admin.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace OCA\files_w2g;
namespace OCA\workin2gether;

\OCP\User::checkAdminUser();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace OCA\files_w2g;
namespace OCA\workin2gether;

\OCP\JSON::checkAdminUser();
\OCP\JSON::checkLoggedIn();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//\OCP\JSON::checkLoggedIn(); Fix 401 unauthorized error. This script may be executed without login!
\OCP\JSON::callCheck();

$query = @OCP\DB::prepare("SELECT * FROM *PREFIX*appconfig where configkey=? and appid='files_w2g' LIMIT 1");
$query = @OCP\DB::prepare("SELECT * FROM *PREFIX*appconfig where configkey=? and appid='workin2gether' LIMIT 1");
$result = @$query->execute(array($_POST['type']))->fetchAll();

if(count($result)>=1) echo $result[0]['configvalue'];
Expand Down
8 changes: 4 additions & 4 deletions files_w2g/ajax/update.php → workin2gether/ajax/update.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace OCA\files_w2g;
namespace OCA\workin2gether;

\OCP\JSON::checkLoggedIn();
\OCP\JSON::callCheck();
Expand All @@ -16,17 +16,17 @@
{ echo "Ajax modification detected";return; }

$l = \OCP\Util::getL10N( app::name );
$configvalue = \OC::$server->getConfig()->getAppValue( 'files_w2g' , $mode , '[unset]' );
$configvalue = \OC::$server->getConfig()->getAppValue( 'workin2gether' , $mode , '[unset]' );

if( $configvalue == '[unset]' )//Value already set?
{
$query = \OCP\DB::prepare("INSERT INTO *PREFIX*appconfig(appid,configkey,configvalue) VALUES('files_w2g',?,?)");
$query = \OCP\DB::prepare("INSERT INTO *PREFIX*appconfig(appid,configkey,configvalue) VALUES('workin2gether',?,?)");
$result = $query->execute(array($mode,$value));
echo $l->t($mode)." ".$l->t("has been set!");
}
else
{
$query = \OCP\DB::prepare("UPDATE *PREFIX*appconfig set configvalue=? WHERE appid='files_w2g' and configkey=?");
$query = \OCP\DB::prepare("UPDATE *PREFIX*appconfig set configvalue=? WHERE appid='workin2gether' and configkey=?");
$result = $query->execute(array($value,$mode));
echo $l->t("Updated successfully!");
}
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?php

namespace OCA\files_w2g;
namespace OCA\workin2gether;

//Init translations
\OCP\Util::addTranslations('files_w2g');
$l = \OCP\Util::getL10N('files_w2g');
\OCP\Util::addTranslations('workin2gether');
$l = \OCP\Util::getL10N('workin2gether');

//Requirements check
\OCP\JSON::checkLoggedIn();
\OCP\JSON::checkAppEnabled('files_w2g');
\OCP\JSON::checkAppEnabled('workin2gether');
\OCP\JSON::callCheck();

////////////////////////////////////////////////////
Expand Down Expand Up @@ -116,7 +116,7 @@ function cleanPath($path){
}

function db_fetcher( &$configkey, $configtype ){
$type = \OCP\DB::prepare("SELECT * FROM *PREFIX*appconfig where configkey=? and appid='files_w2g' LIMIT 1")->execute(array($configtype))->fetchAll();
$type = \OCP\DB::prepare("SELECT * FROM *PREFIX*appconfig where configkey=? and appid='workin2gether' LIMIT 1")->execute(array($configtype))->fetchAll();

if (count($type) >= 1)
$configkey = $type[0]['configvalue'];
Expand Down
8 changes: 4 additions & 4 deletions files_w2g/appinfo/app.php → workin2gether/appinfo/app.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?php

namespace OCA\files_w2g;
namespace OCA\workin2gether;

\OCP\Util::addTranslations('files_w2g');
\OCP\Util::addTranslations('workin2gether');

$l = \OCP\Util::getL10N('files_w2g');
$l = \OCP\Util::getL10N('workin2gether');

class app{

const name = 'files_w2g';
const name = 'workin2gether';

const table = 'locks_w2g';

Expand Down
10 changes: 5 additions & 5 deletions files_w2g/appinfo/info.xml → workin2gether/appinfo/info.xml
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
<?xml version="1.0"?>
<info xmlns:xsi= "http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://apps.nextcloud.com/schema/apps/info.xsd">
<id>files_w2g</id>
<id>workin2gether</id>
<name>Workin2gether</name>
<summary>Visual locking of files and folders to contribute to a better collaboration</summary>
<description>
<![CDATA[Pseudo multiaccess-management feature for Owncloud.
You can lock files and disable the fileactions, leaving only the fileaction of unlocking a file.
Please leave your feedback and rate this app, if you like it!
!]]></description>
]]></description>
<licence>AGPL</licence>
<author mail="patrick@gen7.de">Patrick Hoffmann</author>
<version>0.9.1</version>
<namespace>files_w2g</namespace>
<author>Patrick Hoffmann</author>
<version>0.9.1.1</version>
<namespace>workin2gether</namespace>
<category>social</category>
<ocsid>164016</ocsid>
<dependencies>
Expand Down
19 changes: 19 additions & 0 deletions workin2gether/appinfo/routes.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

namespace OCA\workin2gether\AppInfo;


$this->create('workin2gether_ajax_getcolor', 'ajax/getcolor.php')
->actionInclude('workin2gether/ajax/getcolor.php');

$this->create('workin2gether_ajax_core', 'ajax/workin2gether.php')
->actionInclude('workin2gether/ajax/workin2gether.php');

$this->create('workin2gether_ajax_update', 'ajax/update.php')
->actionInclude('workin2gether/ajax/update.php');

$this->create('workin2gether_ajax_admin_db', 'ajax/admin_db.php')
->actionInclude('workin2gether/ajax/admin_db.php');

$this->create('workin2gether_admin', 'admin.php')
->actionInclude('workin2gether/admin.php');
1 change: 1 addition & 0 deletions workin2gether/appinfo/version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.9.1.1
File renamed without changes.
File renamed without changes
File renamed without changes
16 changes: 8 additions & 8 deletions files_w2g/js/admin.js → workin2gether/js/admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ $(document).ready(function(){

$('#submitColor').click(function(){
$.ajax({
url: OC.filePath('files_w2g','ajax','update.php'),
url: OC.filePath('workin2gether','ajax','update.php'),
type: "post",
data: { mode: 'color', value: $('#multicolor').val()},
async: false,
Expand All @@ -13,7 +13,7 @@ $(document).ready(function(){

$('#submitfontcolor').click(function(){
$.ajax({
url: OC.filePath('files_w2g','ajax','update.php'),
url: OC.filePath('workin2gether','ajax','update.php'),
type: "post",
data: { mode: 'fontcolor', value: $('#multifontcolor').val()},
async: false,
Expand All @@ -24,7 +24,7 @@ $(document).ready(function(){

$('input:radio[name="suffix"]').change(function(){
$.ajax({
url: OC.filePath('files_w2g','ajax','update.php'),
url: OC.filePath('workin2gether','ajax','update.php'),
type: "post",
data: { mode: 'suffix', value: $("input:radio[name='suffix']:checked").attr('id')},
async: false,
Expand All @@ -35,26 +35,26 @@ $(document).ready(function(){

$('#clearall').click(function(){
$.ajax({
url: OC.filePath('files_w2g','ajax','admin_db.php'),
url: OC.filePath('workin2gether','ajax','admin_db.php'),
type: "post",
data: { action: 'clearall'},
async: false,
success: function(data){
if(data=="clear") $('#lockfield').html(t("files_w2g","There are no locked files at the moment"));},
if(data=="clear") $('#lockfield').html(t("workin2gether","There are no locked files at the moment"));},
});
});

$('#clearthis').click(function(){
$.ajax({
url: OC.filePath('files_w2g','ajax','admin_db.php'),
url: OC.filePath('workin2gether','ajax','admin_db.php'),
type: "post",
data: { action: 'clearthis',lock: $('#select_lock option:selected').val()},
async: false,
success: function(data){
if(data=="clear") $('#select_lock option:selected').remove();

if($.trim($('#select_lock').html())=="")
$('#lockfield').html(t("files_w2g","There are no locked files at the moment"));
$('#lockfield').html(t("workin2gether","There are no locked files at the moment"));

},
});
Expand All @@ -68,7 +68,7 @@ $(document).ready(function(){
extended_checked = $('#w2g_lock_permission_extended').attr('checked')? 1 : 0;

$.ajax({
url: OC.filePath('files_w2g','ajax','update.php'),
url: OC.filePath('workin2gether','ajax','update.php'),
type: "post",
data: { mode: 'extended',value: extended_checked },
async: false,
Expand Down
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
20 changes: 10 additions & 10 deletions files_w2g/js/workin2gether.js → workin2gether/js/workin2gether.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,20 @@ $(document).ready(function(){

//The default text, if no translation is available
text = "filelock";
//t('files_w2g','filelock');
lockedtext = t('files_w2g','File is locked');
lockstate = t('files_w2g','Status: locked');
//t('workin2gether','filelock');
lockedtext = t('workin2gether','File is locked');
lockstate = t('workin2gether','Status: locked');

if (typeof FileActions !== 'undefined' && $('#dir').length>0) {

//Initiate the FileAction for file
OCA.Files.fileActions.registerAction({
name:'getstate_w2g',
displayName: t('files_w2g',text),
displayName: t('workin2gether',text),
mime: 'all',
permissions: OC.PERMISSION_ALL,
type: OCA.Files.FileActions.TYPE_INLINE,
icon: function(){ return OC.imagePath('files_w2g','lock.png')},
icon: function(){ return OC.imagePath('workin2gether','lock.png')},
actionHandler: function(filename,context)
{
getState(context.$file.attr('data-id'),filename,context.$file.attr('data-share-owner'),"false");
Expand All @@ -41,7 +41,7 @@ $(document).ready(function(){

//Get the Background-color from the database
$.ajax({
url: OC.filePath('files_w2g','ajax','getcolor.php'),
url: OC.filePath('workin2gether','ajax','getcolor.php'),
type: "post",
data: { type: 'color'},
async: false,
Expand All @@ -50,7 +50,7 @@ $(document).ready(function(){

//Get the Fontcolor from the database
$.ajax({
url: OC.filePath('files_w2g','ajax','getcolor.php'),
url: OC.filePath('workin2gether','ajax','getcolor.php'),
type: "post",
data: { type: 'fontcolor'},
async: false,
Expand Down Expand Up @@ -108,7 +108,7 @@ function getState(_id, _filename, _owner, _safe)
oc_path = oc_dir +'/'+_filename;

$.ajax({
url: OC.filePath('files_w2g','ajax','workin2gether.php'),
url: OC.filePath('workin2gether','ajax','workin2gether.php'),
type: "post",
data: { path: escapeHTML(oc_path), safe: _safe, owner: _owner, id: _id},
success: function(data){postmode(_filename,data)},
Expand All @@ -120,14 +120,14 @@ function postmode(filename,data)
{
filename = filename.replace(/%20/g,' ');

var html = '<img class="svg" src="'+OC.imagePath('files_w2g','lock.png')+'"></img> '+'<span>'+escapeHTML(data)+'</span>';
var html = '<img class="svg" src="'+OC.imagePath('workin2gether','lock.png')+'"></img> '+'<span>'+escapeHTML(data)+'</span>';

//Push the status
$('tr').filterAttr('data-file',filename).find('td.filename').find('a.name').find('span.fileactions').find("a.action").filterAttr('data-action','getstate_w2g').html(html);

//Push the status text to the locked mime
$('tr').filterAttr('data-file',filename).find('td.filename').find('a.namelock').find('span.fileactions').find("a.action").filterAttr('data-action','getstate_w2g').html(html);

if(data!=t('files_w2g','No permission'))
if(data!=t('workin2gether','No permission'))
toggle_control(filename);
}
2 changes: 1 addition & 1 deletion files_w2g/l10n/de.js → workin2gether/l10n/de.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
OC.L10N.register(
"files_w2g",
"workin2gether",
{
"File not locked" : "Datei nicht gesperrt",
"File is locked" : "Datei ist gesperrt",
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion files_w2g/l10n/de_DE.js → workin2gether/l10n/de_DE.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
OC.L10N.register(
"files_w2g",
"workin2gether",
{
"File not locked" : "Datei nicht gesperrt",
"File is locked" : "Datei ist gesperrt",
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
OC.L10N.register(
"files_w2g",
"workin2gether",
{
"File not locked" : "File not locked",
"File is locked" : "File is locked",
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion files_w2g/l10n/en_GB.js → workin2gether/l10n/en_GB.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
OC.L10N.register(
"files_w2g",
"workin2gether",
{
"File not locked" : "File not locked",
"File is locked" : "File is locked",
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion files_w2g/l10n/fr.js → workin2gether/l10n/fr.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
OC.L10N.register(
"files_w2g",
"workin2gether",
{
"File not locked" : "Fichier non verrouillé ",
"File is locked" : " Fichier verrouillé ",
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion files_w2g/l10n/fr_FR.js → workin2gether/l10n/fr_FR.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
OC.L10N.register(
"files_w2g",
"workin2gether",
{
"File not locked" : "Fichier non verrouillé ",
"File is locked" : " Fichier verrouillé ",
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion files_w2g/l10n/ja.js → workin2gether/l10n/ja.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
OC.L10N.register(
"files_w2g",
"workin2gether",
{
"File not locked" : "ファイルロック無し",
"File is locked" : "ファイルロック中",
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion files_w2g/l10n/ja_JP.js → workin2gether/l10n/ja_JP.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
OC.L10N.register(
"files_w2g",
"workin2gether",
{
"File not locked" : "ファイルロック無し",
"File is locked" : "ファイルロック中",
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace OCA\files_w2g;
namespace OCA\workin2gether;

//-------------------------------------------- Get colors from database ------------------------------------------------------

Expand Down Expand Up @@ -88,7 +88,7 @@
<?php

function db_fetcher( &$configkey, $configtype ){
$type = \OCP\DB::prepare("SELECT * FROM *PREFIX*appconfig where configkey=? and appid='files_w2g' LIMIT 1")->execute(array($configtype))->fetchAll();
$type = \OCP\DB::prepare("SELECT * FROM *PREFIX*appconfig where configkey=? and appid='workin2gether' LIMIT 1")->execute(array($configtype))->fetchAll();

if (count($type) >= 1)
$configkey = $type[0]['configvalue'];
Expand Down

0 comments on commit 732cc27

Please sign in to comment.