Remove another accidently added 3rdparty app

This commit is contained in:
Michael Gapczynski 2012-07-30 10:37:54 -04:00
parent 530e7f03cd
commit 29dab0846e
22 changed files with 0 additions and 692 deletions

View File

@ -1,112 +0,0 @@
<?php
/**
* ownCloud - ATNotes plugin
*
* @author Xavier Beurois
* @copyright 2012 Xavier Beurois www.djazz-lab.net
*
* 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/template.php');
OC_JSON::checkLoggedIn();
OC_JSON::checkAppEnabled('atnotes');
$p = trim($_POST['p']);
$top = FALSE;
if($p == '/'){
$p = OC::$CONFIG_DATADIRECTORY;
$top = TRUE;
}
$files = Array();
foreach(OC_Files::getdirectorycontent($p) as $i){
$elt = '';
if($i['type'] == 'file'){
$fileinfo = pathinfo($i['name']);
$i['basename'] = $fileinfo['filename'];
if (!empty($fileinfo['extension'])){
$i['extention'] = '.'.$fileinfo['extension'];
}else{
$i['extention'] = '';
}
}
if($i['directory'] == '/'){
$i['directory'] = '';
}
if($i['extention'] == '.txt' || $i['type'] == 'dir'){
$i["date"] = OC_Util::formatDate($i["mtime"]);
$write = ($i['writeable'])?'true':'false';
$simple_file_size = simple_file_size($i['size']);
$simple_size_color = intval(200 - $i['size'] / (1024 * 1024) * 2);
if($simple_size_color < 0){
$simple_size_color = 0;
}
$relative_modified_date = relative_modified_date($i['mtime']);
$relative_date_color = round((time() - $i['mtime']) / 60 / 60 / 24 * 14);
if($relative_date_color > 200){
$relative_date_color = 200;
}
$name = str_replace('+', '%20', urlencode($i['name']));
$name = str_replace('%2F', '/', $name);
$directory = str_replace('+', '%20', urlencode($i['directory']));
$directory = str_replace('%2F', '/', $directory);
$elt .= '<tr data-file="'.$name.'" data-type="'.(($i['type'] == 'dir')?'dir':'file').'" data-mime="'.$i['mime'].'" data-size="'.$i['size'].'" data-write="'.$write.'">';
$elt .= '<td class="filename svg" data-rel="'.$directory.'/'.$name.'" style="background-image:url('.(($i['type'] == 'dir')?mimetype_icon('dir'):mimetype_icon($i['mime'])).')">';
$elt .= '<span class="nametext">';
if($i['type'] == 'dir'){
$elt .= htmlspecialchars($i['name']);
}else{
$elt .= htmlspecialchars($i['basename']).'<span class="extention">'.$i['extention'].'</span>';
}
$elt .= '</span>';
$elt .= '</td>';
$elt .= '<td class="filesize" title="'.human_file_size($i['size']).'" style="color:rgb('.$simple_size_color.','.$simple_size_color.','.$simple_size_color.')">'.$simple_file_size.'</td>';
$elt .= '<td class="date"><span class="modified" title="'.$i['date'].'" style="color:rgb('.$relative_date_color.','.$relative_date_color.','.$relative_date_color.')">'.$relative_modified_date.'</span></td>';
$elt .= '</tr>';
$files[] = $elt;
}
}
if(!$top){
$p = str_replace('+', '%20', urlencode($p));
$p = str_replace('%2F', '/', $p);
$p = substr($p,0,strrpos($p,'/'));
if(strlen($p) == 0){
$p = '/';
}
$elt = '<tr>';
$elt .= '<td class="filename svg" data-rel="'.$p.'" style="background-image:url('.mimetype_icon('dir').')">';
$elt .= '<span class="nametext">..</span>';
$elt .= '</td>';
$elt .= '<td class="filesize">&nbsp;</td>';
$elt .= '<td class="date">&nbsp;</td>';
$elt .= '</tr>';
array_unshift($files, $elt);
}
OC_JSON::encodedPrint($files);

View File

@ -1,56 +0,0 @@
<?php
/**
* ownCloud - ATNotes plugin
*
* @author Xavier Beurois
* @copyright 2012 Xavier Beurois www.djazz-lab.net
*
* 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/>.
*
*/
OCP\JSON::checkLoggedIn();
OCP\JSON::checkAppEnabled('atnotes');
$p = trim($_POST['p']);
$t = trim($_POST['t']);
$normalizeChars = array(
'Á'=>'A', 'À'=>'A', 'Â'=>'A', 'Ã'=>'A', 'Å'=>'A', 'Ä'=>'A', 'Æ'=>'AE', 'Ç'=>'C',
'É'=>'E', 'È'=>'E', 'Ê'=>'E', 'Ë'=>'E', 'Í'=>'I', 'Ì'=>'I', 'Î'=>'I', 'Ï'=>'I', 'Ð'=>'Eth',
'Ñ'=>'N', 'Ó'=>'O', 'Ò'=>'O', 'Ô'=>'O', 'Õ'=>'O', 'Ö'=>'O', 'Ø'=>'O',
'Ú'=>'U', 'Ù'=>'U', 'Û'=>'U', 'Ü'=>'U', 'Ý'=>'Y',
'á'=>'a', 'à'=>'a', 'â'=>'a', 'ã'=>'a', 'å'=>'a', 'ä'=>'a', 'æ'=>'ae', 'ç'=>'c',
'é'=>'e', 'è'=>'e', 'ê'=>'e', 'ë'=>'e', 'í'=>'i', 'ì'=>'i', 'î'=>'i', 'ï'=>'i', 'ð'=>'eth',
'ñ'=>'n', 'ó'=>'o', 'ò'=>'o', 'ô'=>'o', 'õ'=>'o', 'ö'=>'o', 'ø'=>'o',
'ú'=>'u', 'ù'=>'u', 'û'=>'u', 'ü'=>'u', 'ý'=>'y',
'ß'=>'sz', 'þ'=>'thorn', 'ÿ'=>'y', ' ' => '_', '"' => '', "'" => ' ', '/' => '-'
);
$r = Array('e' => FALSE, 'p' => '');
if(strlen($p) != 0 && strlen($t) != 0){
$fs = OCP\Files::getStorage('files');
if($fs->is_dir($p)){
$r['p'] = $p.'/'.strtr($t, $normalizeChars).'.txt';
}else{
$r['p'] = $p;
}
if($fs->file_exists($r['p'])){
$r['e'] = TRUE;
}
}
OCP\JSON::encodedPrint($r);

View File

@ -1,34 +0,0 @@
<?php
/**
* ownCloud - ATNotes plugin
*
* @author Xavier Beurois
* @copyright 2012 Xavier Beurois www.djazz-lab.net
*
* 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/>.
*
*/
OCP\JSON::checkLoggedIn();
OCP\JSON::checkAppEnabled('atnotes');
$i = trim($_POST['i']);
$r = Array('e' => 1);
if(is_numeric($i)){
$r['e'] = OC_ATNotes::deleteNote($i);
}
OCP\JSON::encodedPrint($r);

View File

@ -1,56 +0,0 @@
<?php
/**
* ownCloud - ATNotes plugin
*
* @author Xavier Beurois
* @copyright 2012 Xavier Beurois www.djazz-lab.net
*
* 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/>.
*
*/
OCP\JSON::checkLoggedIn();
OCP\JSON::checkAppEnabled('atnotes');
$p = trim($_POST['p']);
$t = trim($_POST['t']);
$c = trim($_POST['c']);
$r = Array('e' => '');
if(strlen($p) != 0 && strlen($t) != 0 && strlen($c) != 0){
$fs = OCP\Files::getStorage('files');
if(!$fp = $fs->fopen($p, 'w')){
$r['e'] = 'Can not open file '.$p;
}else{
if(fwrite($fp, $t."\n") === FALSE){
$r['e'] = 'Can not write to file '.$p;
}else{
$c = preg_replace('/<br[.*]{0,}>/',"\n",$c);
$c = preg_replace('/<u[.*]{0,}>/','',$c);$c = preg_replace('/<\/u>/','',$c);
$c = preg_replace('/<b[.*]{0,}>/','',$c);$c = preg_replace('/<\/b>/','',$c);
$c = preg_replace('/<i[.*]{0,}>/','',$c);$c = preg_replace('/<\/i>/','',$c);
$c = preg_replace('/<hr.*>/',"------------------------\n",$c);
$c = preg_replace('/<sup[.*]{0,}>/','(',$c);$c = preg_replace('/<\/sup>/',')',$c);
$c = preg_replace('/<sub[.*]{0,}>/','(',$c);$c = preg_replace('/<\/sub>/',')',$c);
if(fwrite($fp, $c) === FALSE){
$r['e'] = 'Can not write to file '.$p;
}else{
fclose($fp);
}
}
}
}
OCP\JSON::encodedPrint($r);

View File

@ -1,36 +0,0 @@
<?php
/**
* ownCloud - ATNotes plugin
*
* @author Xavier Beurois
* @copyright 2012 Xavier Beurois www.djazz-lab.net
*
* 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/>.
*
*/
OCP\JSON::checkLoggedIn();
OCP\JSON::checkAppEnabled('atnotes');
$i = trim($_POST['i']);
$t = trim($_POST['t']);
$c = trim($_POST['c']);
$r = Array('e' => '', 'i' => 0);
if(strlen($t) != 0){
$r['i'] = OC_ATNotes::saveNote($i,$t,$c);
}
OCP\JSON::encodedPrint($r);

View File

@ -1,39 +0,0 @@
<?php
/**
* ownCloud - ATNotes plugin
*
* @author Xavier Beurois
* @copyright 2012 Xavier Beurois www.djazz-lab.net
*
* 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/>.
*
*/
OCP\App::checkAppEnabled('atnotes');
OC::$CLASSPATH['OC_ATNotes'] = 'apps/atnotes/lib/atnotes.class.php';
OCP\App::register(Array(
'order' => 29,
'id' => 'atnotes',
'name' => 'ATNotes'
));
OCP\App::addNavigationEntry(Array(
'id' => 'atnotes_index',
'order' => 29,
'href' => OCP\Util::linkTo('atnotes', 'atnotes.php'),
'icon' => OCP\Util::imagePath('atnotes', 'icon.png'),
'name' => 'ATNotes'
));

View File

@ -1,79 +0,0 @@
<?xml version="1.0" encoding="ISO-8859-1" ?>
<database>
<name>*dbname*</name>
<create>true</create>
<overwrite>false</overwrite>
<charset>utf8</charset>
<table>
<name>*dbprefix*atnotes</name>
<declaration>
<field>
<name>note_id</name>
<type>integer</type>
<default>0</default>
<notnull>true</notnull>
<autoincrement>1</autoincrement>
<unsigned>true</unsigned>
<length>4</length>
</field>
<field>
<name>oc_uid</name>
<type>text</type>
<notnull>true</notnull>
<length>64</length>
</field>
<field>
<name>create_ts</name>
<type>integer</type>
<notnull>true</notnull>
<length>11</length>
</field>
<field>
<name>update_ts</name>
<type>integer</type>
<notnull>false</notnull>
<default>0</default>
<length>11</length>
</field>
<field>
<name>note_title</name>
<type>text</type>
<notnull>true</notnull>
<length>255</length>
</field>
<field>
<name>note_content</name>
<type>clob</type>
<notnull>false</notnull>
</field>
<field>
<name>note_file</name>
<type>text</type>
<notnull>false</notnull>
<length>255</length>
</field>
<field>
<name>is_deleted</name>
<type>integer</type>
<default>0</default>
<notnull>true</notnull>
<length>1</length>
</field>
<field>
<name>is_shared</name>
<type>integer</type>
<default>0</default>
<notnull>true</notnull>
<length>1</length>
</field>
<index>
<name>note_pk</name>
<primary>true</primary>
<field>
<name>note_id</name>
<sorting>ascending</sorting>
</field>
</index>
</declaration>
</table>
</database>

View File

@ -1,11 +0,0 @@
<?xml version="1.0"?>
<info>
<id>atnotes</id>
<name>ATNotes</name>
<description>ATNotes for Always Take Notes. Create/Edit/Delete notes in the application. You can export notes to save them in your ownCloud filesystem and you can access them through the WebDAV protocol.</description>
<version>1.0</version>
<licence>AGPL</licence>
<author>Xavier Beurois (www.djazz-lab.net)</author>
<require>4</require>
<shipped>true</shipped>
</info>

View File

@ -1,29 +0,0 @@
<?php
/**
* ownCloud - ATNotes plugin
*
* @author Xavier Beurois
* @copyright 2012 Xavier Beurois www.djazz-lab.net
*
* 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/>.
*
*/
OCP\User::checkLoggedIn();
OCP\App::checkAppEnabled('atnotes');
$tmpl = new OCP\Template('atnotes', 'main.tpl', 'user');
$tmpl->assign('notes_list', OC_ATNotes::getNotesList());
$tmpl->printPage();

View File

@ -1,22 +0,0 @@
/**
* ownCloud - ATNotes plugin
*
* @author Xavier Beurois
* @copyright 2012 Xavier Beurois www.djazz-lab.net
*
* 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/>.
*
*/
#atnotes_container{min-width:830px}#atnotes_container div#controls div.title{color:#BBB;font-style:italic;padding:.7em .5em .5em}#atnotes_container ul.atnotes-noteslist{background:none repeat scroll 0 0 #f8f8f8;border-right:1px solid #DDD;overflow:auto;position:fixed;top:6.3em;width:20em;box-shadow:-2px -3px 7px #000;z-index:2}#atnotes_container ul.atnotes-noteslist li.atnotes-elt{border-bottom:1px solid #CCC;padding:.3em .8em 1em;-moz-transition:background-color 500ms ease 0s;background:none repeat scroll 0 0 #f8f8f8;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}#atnotes_container ul.atnotes-noteslist li.atnotes-elt:hover,#atnotes_container ul.atnotes-noteslist li.atnotes-elt.active{background:none repeat scroll 0 0 #eee}#atnotes_container ul.atnotes-noteslist li.atnotes-elt:hover div{cursor:pointer}#atnotes_container ul.atnotes-noteslist li.atnotes-elt div.atnotes-elt-title{font-weight:bold;white-space:pre-wrap;width:18.4em}#atnotes_container ul.atnotes-noteslist li.atnotes-elt div.atnotes-elt-state{float:left;width:10em;font-style:italic;color:#AAA}#atnotes_container ul.atnotes-noteslist li.atnotes-elt div.atnotes-elt-date{color:#999;float:right;width:7em;text-align:right}#atnotes_container ul.atnotes-noteslist li.atnotes-elt div.atnotes-elt-prerender{display:none}#atnotes_container div.atnotes-notesedit{left:20em;position:absolute;top:2.9em}#atnotes_container div.atnotes-notesedit div.anotes-notesedit-states{box-shadow:0 4px 7px #AAA}#atnotes_container div.atnotes-notesedit div.anotes-notesedit-states div.atnotes-saved{float:right}#atnotes_container div.atnotes-notesedit div.anotes-notesedit-title,#atnotes_container div.atnotes-notesedit div.anotes-notesedit-states{padding:.5em 2em;background-color:#FFF;border-bottom:1px solid #CCC;height:1.8em;z-index:1;min-width:350px}#atnotes_container div.atnotes-notesedit div.anotes-notesedit-states{padding:.5em 2em .5em 22em}#atnotes_container div.atnotes-notesedit div.anotes-notesedit-title input#note_title{box-shadow:none;background:0;-moz-border-radius:0;-webkit-border-radius:0;padding:0;margin:0;border:0 none}#atnotes_container div.atnotes-notesedit div.anotes-notesedit-title div.atnotes-actions-btns{float:right;margin-top:.5em}#atnotes_container div.atnotes-notesedit div.anotes-notesedit-title div.atnotes-actions-btns img{cursor:pointer}#atnotes_container div.atnotes-notesedit div.anotes-notesedit-title div.atnotes-actions-btns img.atnotes-actions-list{margin-right:1em}#atnotes_container div.atnotes-notesedit div.anotes-notesedit-title div.atnotes-actions-btns div.atnotes-actions-ddmenu{display:none}#atnotes_container div.jqte{left:20em;position:absolute;top:5.8em;border:0 none;resize:none;min-width:350px}#save_dialog div.atnotes-explorer{background-color:#FFF;border:1px solid #AAA;height:100%;width:100%;overflow-x:auto;overflow-y:visible}#save_dialog div.atnotes-explorer table{width:100%}#save_dialog div.atnotes-explorer table tr td.filename{width:70%;background-position:0 .1em;background-repeat:no-repeat;padding-left:1.7em;cursor:pointer}#save_dialog div.atnotes-explorer table tr td.filename span{cursor:pointer}#save_dialog div.atnotes-explorer table tr td.filesize{width:10%;text-align:center}#save_dialog div.atnotes-explorer table tr td.date{width:20%;text-align:center}.ui-tooltip-content ul li:hover{color:#AAA;background-color:#1a1a1a}

View File

@ -1,11 +0,0 @@
/*!
* http://jqueryte.com
* jQuery Text Editor 1.0.2
* Copyright (C) 2012, Fatih Koca (fatihkoca@me.com), AUTHOR.txt (http://jqueryte.com/about)
* This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program 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 General Public License for more details.
You should have received a copy of the GNU General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
.jqte{overflow:hidden}.jqte *{font-family:Arial,Helvetica,sans-serif;font-size:14px;color:#333}.jqte_Panel{height:25px;padding:5px 8px}.jqte_Panel a{display:block;float:left;width:22px;height:22px;border:#FFF 1px solid;text-align:center;background:url('/apps/atnotes/img/jquery-te-toolbar.png') no-repeat;font-weight:bold;cursor:pointer;-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px}.jqte_Panel a.bold{background-position:0 0}.jqte_Panel a.italic{background-position:-22px 0}.jqte_Panel a.underline{background-position:-44px 0}.jqte_Panel a.orderedlist{background-position:-66px 0}.jqte_Panel a.unorderedlist{background-position:-88px 0}.jqte_Panel a.subscript{background-position:-110px 0}.jqte_Panel a.superscript{background-position:-132px 0}.jqte_Panel a.strike{background-position:-154px 0}.jqte_Panel a.remove{background-position:-176px 0}.jqte_Panel a.rule{background-position:-198px 0}.jqte_Panel a:hover,.jqte_Active{border:#CCC 1px solid!important;box-shadow:inset 0 0 2px #999;background-color:#FFF}.jqte_Panel a:active,.jqte_Active{background-color:#DDD!important}.jqte_Content{overflow-y:auto;position:absolute;top:3.3em;left:.7em;padding-right:.3em}.jqte_Content div,.jqte_Content p{margin:7px 0}.jqte_Content ul{list-style-type:disc}.jqte_Content ol{list-style-type:decimal}.jqte_Content ol,.jqte_Content ul{list-style-position:inside}

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 697 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 117 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 201 B

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,88 +0,0 @@
<?php
/**
* ownCloud - ATNotes plugin
*
* @author Xavier Beurois
* @copyright 2012 Xavier Beurois www.djazz-lab.net
*
* 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/>.
*
*/
/**
* This class manages atnote db.
*/
class OC_ATNotes {
/**
* Save note
* @param $title Title of the note
* @param $content Content of the note
* @return $id Id of the saved note
*/
public static function saveNote($id,$title,$content){
if($id == 0){
$query = OCP\DB::prepare('INSERT INTO *PREFIX*atnotes (oc_uid,create_ts,update_ts,note_title,note_content) VALUES (?,?,?,?,?)');
$query->execute(Array(OCP\User::getUser(),time(),time(),$title,$content));
$id = OCP\DB::insertid('*PREFIX*atnotes');
}else{
$query = OCP\DB::prepare('UPDATE *PREFIX*atnotes SET update_ts=?,note_title=?,note_content=? WHERE note_id=?');
$query->execute(Array(time(),$title,$content,$id));
}
return $id;
}
/**
* Get list
* @return Array()
*/
public static function getNotesList(){
$query = OCP\DB::prepare('SELECT * FROM *PREFIX*atnotes WHERE oc_uid=? AND is_deleted=? ORDER BY update_ts DESC');
$results = $query->execute(Array(OCP\User::getUser(),0))->fetchAll();
return $results;
}
/**
* Get note
* @param $id The note db id
* @return Array if note found or Boolean FALSE
*/
public static function getNote($id){
$query = OCP\DB::prepare('SELECT * FROM *PREFIX*atnotes WHERE oc_uid=? AND is_deleted=? AND note_id=?');
$result = $query->execute(Array(OCP\User::getUser(),0,$id))->fetchRow();
if($result){
return $result;
}else{
return FALSE;
}
}
/**
* Delete note
* @param $id The note db id
* @return Boolean
*/
public static function deleteNote($id){
if(self::getNote($id)){
$query = OCP\DB::prepare('DELETE FROM *PREFIX*atnotes WHERE oc_uid=? AND note_id=?');
$query->execute(Array(OCP\User::getUser(),$id));
if(!self::getNote($id)){
return 0;
}
}
return 1;
}
}

View File

@ -1,71 +0,0 @@
<?php
/**
* ownCloud - ATNotes plugin
*
* @author Xavier Beurois
* @copyright 2012 Xavier Beurois www.djazz-lab.net
*
* 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/>.
*
*/
OCP\Util::addStyle('atnotes','jquery-te-1.0.3.min');
OCP\Util::addScript('atnotes','jquery-te-1.0.3.min');
OCP\Util::addStyle('atnotes','jquery.qtip.min');
OCP\Util::addScript('atnotes','jquery.qtip.min');
OCP\Util::addStyle('atnotes','atnotes.min');
OCP\Util::addScript('atnotes','atnotes.min');
?>
<div id="atnotes_container">
<div id="save_dialog">
<div class="atnotes-explorer"><table border="0" cellpadding="0" cellspacing="0"></table></div>
</div>
<div id="controls">
<div class="title"><?php print('Always Take Notes !'); ?></div>
</div>
<ul class="atnotes-noteslist">
<?php foreach($_['notes_list'] as $note){ ?>
<li class="atnotes-elt" rel="<?php print($note['note_id']); ?>">
<div class="atnotes-elt-title"><?php print($note['note_title']); ?></div>
<div class="atnotes-elt-state"></div>
<div class="atnotes-elt-date"><?php print(date('m/d/Y', $note['update_ts'])); ?></div>
<div class="atnotes-elt-prerender"><?php print($note['note_content']); ?></div>
</li>
<?php } ?>
</ul>
<div class="atnotes-notesedit">
<div class="anotes-notesedit-title">
<input type="text" id="note_title" rel="0" maxlength="255" />
<input type="hidden" id="note_path" maxlength="255" />
<div class="atnotes-actions-btns">
<img class="atnotes-actions-list" src="<?php print(OCP\Util::imagePath('atnotes','action.png')); ?>" />
<div class="atnotes-actions-ddmenu">
<ul>
<li class="atnotes-new">New note</li>
<li class="atnotes-delete">Delete note</li>
</ul>
</div>
<img class="atnotes-save" src="<?php print(OCP\Util::imagePath('atnotes','save.png')); ?>" />
</div>
</div>
<div class="anotes-notesedit-states">
<div class="atnotes-created"></div>
<div class="atnotes-saved"></div>
</div>
</div>
<textarea class="atnotes-editor"></textarea>
</div>

2
remote/.gitignore vendored
View File

@ -1,2 +0,0 @@
*
!.gitignore