diff options
author | Bart Visscher <bartv@thisnet.nl> | 2013-07-19 15:13:02 +0400 |
---|---|---|
committer | Bart Visscher <bartv@thisnet.nl> | 2013-07-19 15:13:02 +0400 |
commit | da4b38738e79a87962859bd9bf91547111d5d374 (patch) | |
tree | f01b936fc1ef915180922632d55dd916f299f81e /files_svgedit | |
parent | a91ad187b4c9d55fa85c4d6ebdbced0bf1068fa6 (diff) |
Change files_svgedit to use the OCP functions instead of the core ones
Diffstat (limited to 'files_svgedit')
-rw-r--r-- | files_svgedit/ajax/save.php | 22 | ||||
-rw-r--r-- | files_svgedit/appinfo/app.php | 2 | ||||
-rw-r--r-- | files_svgedit/index.php | 26 | ||||
-rw-r--r-- | files_svgedit/templates/editor.php | 2 |
4 files changed, 26 insertions, 26 deletions
diff --git a/files_svgedit/ajax/save.php b/files_svgedit/ajax/save.php index 62b74b287..f7696870a 100644 --- a/files_svgedit/ajax/save.php +++ b/files_svgedit/ajax/save.php @@ -8,7 +8,7 @@ require_once '../../../lib/base.php'; // Check if we are a user -OC_JSON::checkLoggedIn(); +OCP\JSON::checkLoggedIn(); // Get paramteres $filecontents = $_POST['file']['filecontents']; @@ -38,20 +38,20 @@ if($path != '' && $mtime != '') { } else { $msg = "File has been modified since opening!"; } - OC_JSON::error(array("data" => array("message" => $msg))); - //OC_Log::write('files_svgedit',"File: ".$path." modified since opening.",OC_Log::ERROR); + OCP\JSON::error(array("data" => array("message" => $msg))); + //OCP\Util::writeLog('files_svgedit',"File: ".$path." modified since opening.",OC_Log::ERROR); exit(); } } else { // file doesn't exist yet, so let's create it! if($file == '') { - OC_JSON::error(array("data" => array( "message" => "Empty Filename") )); + OCP\JSON::error(array("data" => array( "message" => "Empty Filename") )); exit(); } \OC\Files\Filesystem::mkdir($dir); if(!\OC\Files\Filesystem::touch($dir . '/' . $file)) { - OC_JSON::error(array("data" => array("message" => "Error when creating new file!"))); - OC_Log::write('files_svgedit', "Failed to create file: " . $path, OC_Log::ERROR); + OCP\JSON::error(array("data" => array("message" => "Error when creating new file!"))); + OCP\Util::writeLog('files_svgedit', "Failed to create file: " . $path, OC_Log::ERROR); exit(); } } @@ -70,13 +70,13 @@ if($path != '' && $mtime != '') { clearstatcache(); // Get new mtime $newmtime = \OC\Files\Filesystem::filemtime($path); - OC_JSON::success(array('data' => array('mtime' => $newmtime))); + OCP\JSON::success(array('data' => array('mtime' => $newmtime))); } else { // Not writable! - OC_JSON::error(array('data' => array( 'message' => 'Insufficient permissions'))); - OC_Log::write('files_svgedit',"User does not have permission to write to file: ".$path,OC_Log::ERROR); + OCP\JSON::error(array('data' => array( 'message' => 'Insufficient permissions'))); + OCP\Util::writeLog('files_svgedit',"User does not have permission to write to file: ".$path,OC_Log::ERROR); } } else { - OC_JSON::error(array('data' => array( 'message' => 'File path or mtime not supplied'))); - OC_Log::write('files_svgedit',"Invalid path supplied:".$path,OC_Log::ERROR); + OCP\JSON::error(array('data' => array( 'message' => 'File path or mtime not supplied'))); + OCP\Util::writeLog('files_svgedit',"Invalid path supplied:".$path,OC_Log::ERROR); } diff --git a/files_svgedit/appinfo/app.php b/files_svgedit/appinfo/app.php index d3ec283e4..e6fa4a77e 100644 --- a/files_svgedit/appinfo/app.php +++ b/files_svgedit/appinfo/app.php @@ -20,7 +20,7 @@ * License along with this library. If not, see <http://www.gnu.org/licenses/>. * */ -OC_Util::addScript('files_svgedit', 'ocsvg'); +OCP\Util::addScript('files_svgedit', 'ocsvg'); OC_App::register(array( 'order' => 50, 'id' => 'files_svgedit', diff --git a/files_svgedit/index.php b/files_svgedit/index.php index 34237f188..a2c4cc999 100644 --- a/files_svgedit/index.php +++ b/files_svgedit/index.php @@ -1,21 +1,21 @@ <?php // Init owncloud require_once '../../lib/base.php'; -OC_Util::checkLoggedIn(); +OCP\User::checkLoggedIn(); OC_Util::checkAppEnabled('files_svgedit'); // load required style sheets: -OC_Util::addStyle('files_svgedit', 'ocsvg'); +OCP\Util::addStyle('files_svgedit', 'ocsvg'); // load required javascripts: -OC_Util::addScript('files_svgedit', 'svg-edit/embedapi'); -OC_Util::addScript('files_svgedit', 'ocsvgEditor'); -OC_Util::addScript('files_svgedit', 'canvg/canvg'); -OC_Util::addScript('files_svgedit', 'canvg/rgbcolor'); -OC_Util::addScript('files_svgedit', 'base64'); -//OC_Util::addScript('files_svgedit', 'jsPDF/libs/sprintf'); -//OC_Util::addScript('files_svgedit', 'jsPDF/jspdf'); -OC_Util::addScript('files_svgedit', 'jsPDF/jspdf.min'); -OC_Util::addScript('files_svgedit', 'svgToPdf'); -OC_App::setActiveNavigationEntry('files_index'); +OCP\Util::addScript('files_svgedit', 'svg-edit/embedapi'); +OCP\Util::addScript('files_svgedit', 'ocsvgEditor'); +OCP\Util::addScript('files_svgedit', 'canvg/canvg'); +OCP\Util::addScript('files_svgedit', 'canvg/rgbcolor'); +OCP\Util::addScript('files_svgedit', 'base64'); +//OCP\Util::addScript('files_svgedit', 'jsPDF/libs/sprintf'); +//OCP\Util::addScript('files_svgedit', 'jsPDF/jspdf'); +OCP\Util::addScript('files_svgedit', 'jsPDF/jspdf.min'); +OCP\Util::addScript('files_svgedit', 'svgToPdf'); +OCP\App::setActiveNavigationEntry('files_index'); $path = $_GET['file']; $writable = \OC\Files\Filesystem::isUpdatable($path); @@ -28,7 +28,7 @@ if(isset($_GET['file']) and $writable) { $filemtime = 0; } -$tmpl = new OC_TEMPLATE( "files_svgedit", "editor", "user" ); +$tmpl = new OCP\Template( "files_svgedit", "editor", "user" ); $tmpl->assign('fileContents', json_encode($filecontents)); $tmpl->assign('filemTime', $filemtime); $tmpl->assign('filePath', json_encode($path)); diff --git a/files_svgedit/templates/editor.php b/files_svgedit/templates/editor.php index 00d6dd47e..c40caab39 100644 --- a/files_svgedit/templates/editor.php +++ b/files_svgedit/templates/editor.php @@ -16,7 +16,7 @@ var ocsvgFile = { <input type="button" id="ocsvgBtnClose" value="<?php p($l->t('Close')); ?>" /> </div> <div id="svgEditor"> - <iframe src="<?php print_unescaped(OC_Helper::linkTo('files_svgedit', 'svg-edit/svg-editor.html')); ?>" id="svgedit"></iframe> + <iframe src="<?php print_unescaped(OCP\Util::linkTo('files_svgedit', 'svg-edit/svg-editor.html')); ?>" id="svgedit"></iframe> </div> <div id="svgEditorSave" title="<?php p($l->t('Save')); ?>"> <ul> |