/** * Get the template for a specific activity-event in the activities * * @param array $activity An array with all the activity data in it * @param return string */ public static function show($activity) { $tmpl = new \OCP\Template('activity', 'activity.box'); $tmpl->assign('formattedDate', \OCP\Util::formatDate($activity['timestamp'])); $tmpl->assign('formattedTimestamp', \OCP\relative_modified_date($activity['timestamp'])); $tmpl->assign('user', $activity['user']); $tmpl->assign('displayName', \OCP\User::getDisplayName($activity['user'])); if ($activity['app'] === 'files') { // We do not link the subject as we create links for the parameters instead $activity['link'] = ''; } $tmpl->assign('event', $activity); if ($activity['file']) { $rootView = new \OC\Files\View(''); $exist = $rootView->file_exists('/' . $activity['user'] . '/files' . $activity['file']); $is_dir = $rootView->is_dir('/' . $activity['user'] . '/files' . $activity['file']); unset($rootView); // show a preview image if the file still exists if (!$is_dir && $exist) { $tmpl->assign('previewLink', \OCP\Util::linkTo('files', 'index.php', array('dir' => dirname($activity['file'])))); $tmpl->assign('previewImageLink', \OCP\Util::linkToRoute('core_ajax_preview', array('file' => $activity['file'], 'x' => 150, 'y' => 150))); } else { if ($exist) { $tmpl->assign('previewLink', \OCP\Util::linkTo('files', 'index.php', array('dir' => $activity['file']))); $tmpl->assign('previewImageLink', \OC_Helper::mimetypeIcon('dir')); $tmpl->assign('previewLinkIsDir', true); } } } return $tmpl->fetchPage(); }
private function getPreviewUrl($path) { $x = 200; $y = 113; $path = substr($path, 6); return \OCP\Util::linkToRoute('core_ajax_preview', array('x' => $x, 'y' => $y, 'file' => urlencode($path))); }
/** * @param $requestToken * @return string */ public function getUrl($requestToken) { if (!$requestToken) { throw new \RuntimeException('No request token given'); } return \OCP\Util::linkToRoute('ocusagecharts.chart_api.load_chart', array('id' => $this->chart->getId(), 'requesttoken' => $requestToken)); }
/** * Get the template for a specific activity-event in the activities * * @param array $activity An array with all the activity data in it * @return string */ public static function show($activity) { $tmpl = new Template('activity', 'activity.box'); $tmpl->assign('formattedDate', Util::formatDate($activity['timestamp'])); $tmpl->assign('formattedTimestamp', \OCP\relative_modified_date($activity['timestamp'])); $tmpl->assign('user', $activity['user']); $tmpl->assign('displayName', User::getDisplayName($activity['user'])); if (strpos($activity['subjectformatted']['markup']['trimmed'], '<a ') !== false) { // We do not link the subject as we create links for the parameters instead $activity['link'] = ''; } $tmpl->assign('event', $activity); if ($activity['file']) { $rootView = new View('/' . $activity['affecteduser'] . '/files'); $exist = $rootView->file_exists($activity['file']); $is_dir = $rootView->is_dir($activity['file']); unset($rootView); // show a preview image if the file still exists $mimetype = \OC_Helper::getFileNameMimeType($activity['file']); if (!$is_dir && \OC::$server->getPreviewManager()->isMimeSupported($mimetype) && $exist) { $tmpl->assign('previewLink', Util::linkTo('files', 'index.php', array('dir' => dirname($activity['file'])))); $tmpl->assign('previewImageLink', Util::linkToRoute('core_ajax_preview', array('file' => $activity['file'], 'x' => 150, 'y' => 150))); } else { $tmpl->assign('previewLink', Util::linkTo('files', 'index.php', array('dir' => $activity['file']))); $tmpl->assign('previewImageLink', \OC_Helper::mimetypeIcon($is_dir ? 'dir' : $mimetype)); $tmpl->assign('previewLinkIsDir', true); } } return $tmpl->fetchPage(); }
public function search($query) { $unescape = function ($value) { return strtr($value, array('\\,' => ',', '\\;' => ';')); }; $searchresults = array(); $results = \OCP\Contacts::search($query, array('N', 'FN', 'EMAIL', 'NICKNAME', 'ORG')); $l = new \OC_l10n('contacts'); foreach ($results as $result) { $link = \OCP\Util::linkToRoute('contacts_index') . '#' . $result['id']; $props = array(); $display = isset($result['FN']) && $result['FN'] ? $result['FN'] : null; foreach (array('EMAIL', 'NICKNAME', 'ORG') as $searchvar) { if (isset($result[$searchvar]) && $result[$searchvar]) { if (is_array($result[$searchvar])) { $result[$searchvar] = array_filter($result[$searchvar]); } $prop = is_array($result[$searchvar]) ? implode(',', $result[$searchvar]) : $result[$searchvar]; $props[] = $prop; $display = $display ?: $result[$searchvar]; } } $props = array_map($unescape, $props); $searchresults[] = new \OC_Search_Result($display, implode(', ', $props), $link, (string) $l->t('Contact'), null); //$name,$text,$link,$type } return $searchresults; }
/** * Constructor * * @param array $data * @return \OCA\Contacts\Search\Contact */ public function __construct(array $data = null) { $this->id = $data['id']; $this->name = stripcslashes($data['FN']); $this->link = \OCP\Util::linkToRoute('contacts_index') . '#' . $data['id']; $this->address = $this->checkAndMerge($data, 'ADR'); $this->phone = $this->checkAndMerge($data, 'TEL'); $this->email = $this->checkAndMerge($data, 'EMAIL'); $this->nickname = $this->checkAndMerge($data, 'NICKNAME'); $this->organization = $this->checkAndMerge($data, 'ORG'); }
/** * Entry point for the chart system * * @NoCSRFRequired * @NoAdminRequired * @return TemplateResponse */ public function frontpage() { $charts = $this->configService->getCharts(); if (count($charts) == 0) { $this->configService->createDefaultConfig(); $charts = $this->configService->getCharts(); } $id = $charts[0]->getId(); $url = \OCP\Util::linkToRoute('ocusagecharts.chart.display_chart', array('id' => $id)); return new RedirectResponse($url); }
private function checkForExpiredPasswords() { $sql = 'SELECT * FROM `*PREFIX*passman_items` where expire_time < ? AND expire_time > 0 '; $expire_time = time() * 1000; $query = $this->db->prepareQuery($sql); $query->bindParam(1, $expire_time, \PDO::PARAM_INT); $result = $query->execute(); $sendTime = time() - 1; while ($row = $result->fetchRow()) { $this->logger->info($row['label'] . ' is expired', array('app' => 'passman')); $remoteUrl = \OCP\Util::linkToRoute('passman.page.index') . '#selectItem=' . $row['id']; $this->notification->add('item_expired', array($row['label']), '', array(), $remoteUrl, $row['user_id'], 'passman_item_expired'); } }
private function getWeatherData($unit) { if ($this->city != "") { $additionalParameter = ""; if ($unit == "c") { $additionalParameter .= "&units=metric"; } $url = $this->basicUrl . $this->city . $this->fixUrlParameter . $additionalParameter; //OCP\Util::writeLog('ocDashboard',"openweather xml url: ".$url, \OCP\Util::DEBUG); $reader = new XMLReader(); $reader->open($url); $data = array(); while ($reader->read()) { if ($reader->nodeType == XMLReader::ELEMENT) { if (isset($this->xmlNodeAttributes[$reader->name])) { $n = 0; while (isset($data[$n][$reader->name])) { $n++; } foreach ($this->xmlNodeAttributes[$reader->name] as $key) { $data[$n][$reader->name][$key] = $reader->getAttribute($key); } if (in_array($reader->name, $this->xmlAddUnit)) { $data[$n][$reader->name]['unit'] = $this->getUnit($reader->name, $unit); } } else { if (isset($this->xmlNodeValueKeys[$reader->name])) { $data[$reader->name] = $reader->readInnerXml(); } } } } $reader->close(); if (count($data) > 0) { $this->weatherData = $data; } else { OCP\Util::writeLog('ocDashboard', "openweather - could not fetch data for " . $this->city, \OCP\Util::ERROR); $this->errorMsg = $this->l->t("Could not fetch data for \"%s\".<br>Please try another value.<br><a href='%s'>» settings</a>", array($this->city, \OCP\Util::linkToRoute('settings_personal'))); } } }
function search($query) { $unescape = function ($value) { return strtr($value, array('\\,' => ',', '\\;' => ';')); }; $app = new App(); $searchresults = array(); $results = \OCP\Contacts::search($query, array('N', 'FN', 'EMAIL', 'NICKNAME', 'ORG')); $l = new \OC_l10n('contacts'); foreach ($results as $result) { $link = \OCP\Util::linkToRoute('contacts_index') . '#' . $result['id']; $props = array(); foreach (array('EMAIL', 'NICKNAME', 'ORG') as $searchvar) { if (isset($result[$searchvar]) && count($result[$searchvar]) > 0 && strlen($result[$searchvar][0]) > 3) { $props = array_merge($props, $result[$searchvar]); } } $props = array_map($unescape, $props); $searchresults[] = new \OC_Search_Result($result['FN'], implode(', ', $props), $link, (string) $l->t('Contact')); //$name,$text,$link,$type } return $searchresults; }
* in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ OCP\App::checkAppEnabled('ocusagecharts'); OCP\App::setActiveNavigationEntry('ocusagecharts'); OCP\App::addNavigationEntry(Array( 'id' => 'ocusagecharts', 'order' => 60, 'href' => \OCP\Util::linkToRoute('ocusagecharts.chart.frontpage'), 'icon' => OCP\Util::imagePath('ocusagecharts', 'iconchart.png'), 'name' => \OC_L10N::get('ocusagecharts')->t('ocUsageCharts') )); \OCP\Util::addStyle('ocusagecharts', 'style'); \OCP\Backgroundjob::registerJob('OCA\ocUsageCharts\Command\UpdateUserStorageCommand');
/** * @param string $messageId * @param $accountId * @param $folderId * @return callable */ private function enrichDownloadUrl($accountId, $folderId, $messageId, $attachment) { $downloadUrl = \OCP\Util::linkToRoute('mail.messages.downloadAttachment', ['accountId' => $accountId, 'folderId' => $folderId, 'messageId' => $messageId, 'attachmentId' => $attachment['id']]); $downloadUrl = \OC::$server->getURLGenerator()->getAbsoluteURL($downloadUrl); $attachment['downloadUrl'] = $downloadUrl; $attachment['mimeUrl'] = \OC_Helper::mimetypeIcon($attachment['mime']); return $attachment; }
<h1><?php p($l->t($_['chart']->getConfig()->getChartType())); ?></h1> <?php echo '<div class="chart" id="chart"><div class="icon-loading" style="height: 60px;"></div></div>'; ?> <?php $url = \OCP\Util::linkToRoute('ocusagecharts.chart_api.load_chart', array('id' => $_['chart']->getConfig()->getId(), 'requesttoken' => $_['requesttoken'])); ?> <div style="display: none;" data-url="<?php echo $url; ?>" id="defaultBar"></div>
type="file" id="article-upload" name="importarticle" news-read-file="Settings.importArticles($fileContent)"/> <button title="<?php p($l->t('Import')); ?>" class="icon-upload svg button-icon-label" ng-class="{'entry-loading': Settings.isArticlesImporting}" ng-disabled= "Settings.isOPMLImporting || Settings.isArticlesImporting" news-trigger-click="#article-upload"> </button> <a title="<?php p($l->t('Export')); ?>" class="button icon-download svg button-icon-label" href="<?php p(\OCP\Util::linkToRoute('news.export.articles')); ?>" target="_blank" ng-hide="App.isFirstRun()"> </a> <button class="icon-download svg button-icon-label" title="<?php p($l->t('Export')); ?>" ng-show="App.isFirstRun()" disabled> </button> <p class="error" ng-show="Settings.articleImportError"> <?php p( $l->t('Error when importing: file does not contain valid JSON') ); ?> </p>
\OCP\App::checkAppEnabled('collaboration'); OCP\App::setActiveNavigationEntry('collaboration'); OCP\Util::addScript('collaboration', 'update_task'); OCP\Util::addScript('collaboration/3rdparty', 'jquery-ui-sliderAccess'); OCP\Util::addScript('collaboration/3rdparty', 'jquery-ui-timepicker-addon'); OCP\Util::addScript('collaboration/3rdparty', 'jquery-te'); OCP\Util::addStyle('collaboration/3rdparty', 'jquery-te'); OCP\Util::addStyle('collaboration/3rdparty', 'jquery-ui-timepicker-addon'); OCP\Util::addStyle('collaboration', 'content_header'); OCP\Util::addStyle('collaboration', 'tabs'); OCP\Util::addStyle('collaboration', 'update_task'); $l = OC_L10N::get('collaboration'); $tpl = new OCP\Template('collaboration', 'update_task', 'user'); $bol = OC_Collaboration_Project::isAdmin(); if ($bol == true) { if (isset($_POST['tid'])) { $tpl->assign('title', $l->t('Update Task')); $tpl->assign('submit_btn_name', $l->t('Update')); $tpl->assign('tid', $_POST['tid']); $tpl->assign('task_details', OC_Collaboration_Task::readTask($_POST['tid'])); } else { $tpl->assign('title', $l->t('Create Task')); $tpl->assign('submit_btn_name', $l->t('Create')); $tpl->assign('projects', OC_Collaboration_Project::getProjects(OC_User::getUser())); } $tpl->printPage(); } else { header('Location: ' . \OCP\Util::linkToRoute('collaboration_route', array('rel_path' => 'dashboard'))); \OCP\Util::writeLog('collaboration', 'Permission denied for ' . OC_User::getUser() . ' to create task.', \OCP\Util::WARN); exit; }
<?php /** * owncloud - talk * * This file is licensed under the Affero General Public License version 3 or * later. See the COPYING file. * * @author Vincent Petry <*****@*****.**> * @copyright Vincent Petry 2014 */ namespace OCA\Talk\AppInfo; $app = new Application(); $c = $app->getContainer(); \OCP\App::registerAdmin($c->query('AppName'), 'settings/admin'); \OCP\App::addNavigationEntry(array('id' => 'talk', 'order' => 10, 'href' => \OCP\Util::linkToRoute('talk.page.index'), 'icon' => \OCP\Util::imagePath('talk', 'app.svg'), 'name' => \OC_L10N::get('talk')->t('Talk')));
/** * get a list of all available versions of a file in descending chronological order * @param string $uid user id from the owner of the file * @param string $filename file to find versions of, relative to the user files dir * @param string $userFullPath * @return array versions newest version first */ public static function getVersions($uid, $filename, $userFullPath = '') { $versions = array(); // fetch for old versions $view = new \OC\Files\View('/' . $uid . '/' . self::VERSIONS_ROOT); $pathinfo = pathinfo($filename); $files = $view->getDirectoryContent($pathinfo['dirname']); $versionedFile = $pathinfo['basename']; foreach ($files as $file) { if ($file['type'] === 'file') { $pos = strrpos($file['path'], '.v'); $currentFile = substr($file['name'], 0, strrpos($file['name'], '.v')); if ($currentFile === $versionedFile) { $version = substr($file['path'], $pos + 2); $key = $version . '#' . $filename; $versions[$key]['cur'] = 0; $versions[$key]['version'] = $version; $versions[$key]['humanReadableTimestamp'] = self::getHumanReadableTimestamp($version); if (empty($userFullPath)) { $versions[$key]['preview'] = ''; } else { $versions[$key]['preview'] = \OCP\Util::linkToRoute('core_ajax_versions_preview', array('file' => $userFullPath, 'version' => $version)); } $versions[$key]['path'] = $filename; $versions[$key]['name'] = $versionedFile; $versions[$key]['size'] = $file['size']; } } } // sort with newest version first krsort($versions); return $versions; }
// Fetch member list $details = array(array()); $i = 0; foreach ($_POST as $key => $value) { if (strpos($key, 'mem_name') === 0) { $id = substr($key, 8); $details[$i]['member'] = $value; $details[$i]['role'] = $_POST['mem_role' . $id]; $details[$i]['email'] = $_POST['mem_email' . $id]; $details[$i]['mobile'] = $_POST['mem_mobile' . $id]; $i++; } } $tpl = new OCP\Template('collaboration', 'display_message', 'user'); $tpl->assign('title', $l->t('Loading...')); $tpl->assign('msg', $l->t('Updating project \'%s\'. Please be patient.', array($_POST['title']))); $tpl->printPage(); $redirect = ''; $post_id = false; if (!isset($_POST['pid'])) { $post_id = OC_Collaboration_Project::createProject($_POST['title'], $_POST['description'], OC_User::getUser(), $_POST['deadline'], $details); $redirect = 'submit_new_project'; } else { $post_id = OC_Collaboration_Project::updateProject($_POST['pid'], $_POST['title'], $_POST['description'], $_POST['deadline'], $details, OC_User::getUser(), isset($_POST['project_completed'])); $redirect = 'submit_change_project'; } if ($post_id != false && isset($_POST['send_mail'])) { OC_Collaboration_Mail::sendProjectAssignmentMail($_POST['title'], $details); } print_unescaped('<META HTTP-EQUIV="Refresh" Content="0; URL=' . \OCP\Util::linkToRoute('collaboration_route', array('rel_path' => $redirect)) . '?post=' . $post_id . '&title=' . $_POST['title'] . '">');
/** * @brief Show a specific event in the activities * @param array $event An array with all the event data in it */ public static function show($event) { $l = \OC_L10N::get('lib'); $user = $event['user']; if (!isset($event['isGrouped'])) { $event['isGrouped'] = false; } $formattedDate = \OCP\Util::formatDate($event['timestamp']); $formattedTimestamp = \OCP\relative_modified_date($event['timestamp']); $displayName = \OCP\User::getDisplayName($user); // TODO: move into template? echo '<div class="box">'; echo '<div class="header">'; echo '<span class="avatar" data-user="******"></span>'; echo '<span>'; echo '<span class="user">' . \OC_Util::sanitizeHTML($displayName) . '</span>'; echo '<span class="activitytime tooltip" title="' . \OC_Util::sanitizeHTML($formattedDate) . '">' . \OC_Util::sanitizeHTML($formattedTimestamp) . '</span>'; echo '<span class="appname">' . \OC_Util::sanitizeHTML($event['app']) . '</span>'; echo '</span>'; echo '</div>'; echo '<div class="messagecontainer">'; if ($event['isGrouped']) { $count = 0; echo '<ul class="activitysubject grouped">'; foreach ($event['events'] as $subEvent) { echo '<li>'; if ($subEvent['link'] != '') { echo '<a href="' . $subEvent['link'] . '">'; } echo \OC_Util::sanitizeHTML($subEvent['subject']); if ($subEvent['link'] != '') { echo '</a>'; } echo '</li>'; $count++; if ($count > 5) { echo '<li class="more">' . $l->n('%n more...', '%n more...', count($event['events']) - $count) . '</li>'; break; } } echo '</ul>'; } else { if ($event['link'] != '') { echo '<a href="' . $event['link'] . '">'; } echo '<div class="activitysubject">' . \OC_Util::sanitizeHTML($event['subject']) . '</div>'; echo '<div class="activitymessage">' . \OC_Util::sanitizeHTML($event['message']) . '</div>'; } $rootView = new \OC\Files\View(''); if ($event['file'] !== null) { $exist = $rootView->file_exists('/' . $user . '/files' . $event['file']); unset($rootView); // show a preview image if the file still exists if ($exist) { echo '<img class="preview" src="' . \OCP\Util::linkToRoute('core_ajax_preview', array('file' => $event['file'], 'x' => 150, 'y' => 150)) . '" />'; } } if (!$event['isGrouped'] && $event['link'] != '') { echo '</a>'; } echo '</div>'; // end messagecontainer echo '</div>'; // end box }
* 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 Affero General Public * License along with this library. If not, see <http://www.gnu.org/licenses/>. * */ print_unescaped($this->inc('tabs')); ?> <div id="app-content"> <div class="cb_contentcontainer"> <div id="content-header" > </div> <div id="content-body" > <form id="task_schedule" action="<?php print_unescaped(\OCP\Util::linkToRoute('collaboration_route', array('rel_path' => 'submit_change_task'))); ?> " method="get" > <input type="hidden" name="task" value="<?php p($_['task']); ?> " /> <input type="hidden" name="title" value="<?php p($_POST['title']); ?> " /> </form> <?php if (strcmp($_['permission_granted'], 'true') == 0) { $event_id = OC_Collaboration_Calendar::getEventId($_POST['tid']); if (!isset($_POST['status'])) {
<?php echo '<div id="app"> <div id="app-navigation"> <ul> '; $chartTypes = array('Storage', 'Activity'); foreach ($chartTypes as $possibleType) { echo '<li class="menu-title"><h2>' . $l->t($possibleType . '_title') . '</h2></li>'; foreach ($_['configs'] as $config) { if (substr($possibleType, 0, 7) !== substr($config->getChartType(), 0, 7)) { continue; } $url = \OCP\Util::linkToRoute('ocusagecharts.chart.display_chart', array('id' => $config->getId())); echo '<li><a href="' . $url . '">' . $l->t($config->getChartType()) . '</a></li>'; } } echo ' </ul> </div> <div id="app-content">'; $requesttoken = $_['requesttoken']; $chart = $_['chart']; $config = $chart->getConfig(); // keep it string to lower, because owncloud forces it $template = strtolower($config->getChartProvider() . '/' . $config->getChartType() . 'View'); echo $this->inc($template, array('chart' => $chart, 'requesttoken' => $requesttoken)); echo ' </div> </div>';
<?php p($l->t('You are accessing the server from an untrusted domain.')); ?> <br> <p class='hint'> <?php p($l->t('Please contact your administrator. If you are an administrator of this instance, configure the "trusted_domains" setting in config/config.php. An example configuration is provided in config/config.sample.php.')); ?> <br> <?php p($l->t('Depending on your configuration, as an administrator you might also be able to use the button below to trust this domain.')); ?> <br><br> <p style="text-align:center;"> <a href="<?php print_unescaped(\OC::$server->getURLGenerator()->getAbsoluteURL(\OCP\Util::linkToRoute('settings_admin'))); ?> ?trustDomain=<?php p($_['domain']); ?> " class="button"> <?php p($l->t('Add "%s" as trusted domain', array($_['domain']))); ?> </a> </p> </p> </li> </ul>
/** * get a list of all available versions of a file in descending chronological order * @param string $uid user id from the owner of the file * @param string $filename file to find versions of, relative to the user files dir * @param string $userFullPath * @return array versions newest version first */ public static function getVersions($uid, $filename, $userFullPath = '') { $versions = array(); if (empty($filename)) { return $versions; } // fetch for old versions $view = new View('/' . $uid . '/'); $pathinfo = pathinfo($filename); $versionedFile = $pathinfo['basename']; $dir = Filesystem::normalizePath(self::VERSIONS_ROOT . '/' . $pathinfo['dirname']); $dirContent = false; if ($view->is_dir($dir)) { $dirContent = $view->opendir($dir); } if ($dirContent === false) { return $versions; } if (is_resource($dirContent)) { while (($entryName = readdir($dirContent)) !== false) { if (!Filesystem::isIgnoredDir($entryName)) { $pathparts = pathinfo($entryName); $filename = $pathparts['filename']; if ($filename === $versionedFile) { $pathparts = pathinfo($entryName); $timestamp = substr($pathparts['extension'], 1); $filename = $pathparts['filename']; $key = $timestamp . '#' . $filename; $versions[$key]['version'] = $timestamp; $versions[$key]['humanReadableTimestamp'] = self::getHumanReadableTimestamp($timestamp); if (empty($userFullPath)) { $versions[$key]['preview'] = ''; } else { $versions[$key]['preview'] = \OCP\Util::linkToRoute('core_ajax_versions_preview', array('file' => $userFullPath, 'version' => $timestamp)); } $versions[$key]['path'] = Filesystem::normalizePath($pathinfo['dirname'] . '/' . $filename); $versions[$key]['name'] = $versionedFile; $versions[$key]['size'] = $view->filesize($dir . '/' . $entryName); } } } closedir($dirContent); } // sort with newest version first krsort($versions); return $versions; }
/** * @NoAdminRequired */ public function addChild() { $params = $this->request->urlParams; $response = new JSONResponse(); $addressBook = $this->app->getAddressBook($params['backend'], $params['addressBookId']); try { $id = $addressBook->addChild(); } catch (\Exception $e) { return $response->bailOut($e->getMessage()); } if ($id === false) { return $response->bailOut(App::$l10n->t('Error creating contact.')); } $contact = $addressBook->getChild($id); $serialized = JSONSerializer::serializeContact($contact); if (is_null($serialized)) { throw new \Exception(App::$l10n->t('Error creating contact')); } $response->setStatus('201')->setETag($contact->getETag()); $response->addHeader('Location', \OCP\Util::linkToRoute('contacts_contact_get', array('backend' => $params['backend'], 'addressBookId' => $params['addressBookId'], 'contactId' => $id))); return $response->setParams($serialized); }
/** * @param $path * @return string */ public static function preview_icon($path) { return \OCP\Util::linkToRoute('core_ajax_trashbin_preview', array('x' => 36, 'y' => 36, 'file' => $path)); }
" class="upload-icon svg" ng-class="{loading: importing}" ng-disabled="importing" oc-forward-click="{selector:'#google-upload'}"> <?php p($l->t('Import')); ?> </button> <a title="<?php p($l->t('Export')); ?> " class="button download-icon svg" href="<?php p(\OCP\Util::linkToRoute('news.export.articles')); ?> " target="_blank" ng-show="feedBusinessLayer.getNumberOfFeeds() > 0"> <?php p($l->t('Export')); ?> </a> <button class="download-icon svg" title="<?php p($l->t('Export')); ?> " ng-hide="feedBusinessLayer.getNumberOfFeeds() > 0" disabled>
* This file is licensed under the Affero General Public License version 3 or * later. See the COPYING file. * * @author Ben Curtis <*****@*****.**> * @copyright Ben Curtis 2015 */ namespace OCA\OwnNote\AppInfo; \OCP\App::addNavigationEntry(array( // the string under which your app will be referenced in owncloud 'id' => 'ownnote', // sorting weight for the navigation. The higher the number, the higher // will it be listed in the navigation 'order' => 10, // the route that will be shown on startup 'href' => \OCP\Util::linkToRoute('ownnote.page.index'), // the icon that will be shown in the navigation // this file needs to exist in img/ 'icon' => \OCP\Util::imagePath('ownnote', 'app.svg'), // the title of your application. This will be used in the // navigation or on the settings page of your app //'name' => \OC_L10N::get('ownnote')->t('Own Note') 'name' => \OC_L10N::get('ownnote')->t('Notes') ));
p($l->t('Edit')); print_unescaped('</a>'); print_unescaped(' | '); print_unescaped('<a class="delete" data-collaboration-type="post" data-collaboration-id="' . $_['details']['post_id'] . '">'); p($l->t('Delete')); print_unescaped('</a>'); print_unescaped('</div>'); } else { if (strcasecmp($_['details']['type'], 'Project Creation') == 0 || strcasecmp($_['details']['type'], 'Project Updation') == 0) { print_unescaped('<span class="view_details" id="project_details_link" >'); print_unescaped('<form method="post" action="' . \OCP\Util::linkToRoute('collaboration_route', array('rel_path' => 'project_details')) . '" ><input type="hidden" name="pid" value="' . $_['details']['pid'] . '" /><a>' . $l->t('View Details') . '</a></form>'); print_unescaped('</span>'); } else { if (strcasecmp($_['details']['type'], 'Task Unassigned') == 0 || strcasecmp($_['details']['type'], 'Task Assign') == 0 || strcasecmp($_['details']['type'], 'Task Status Changed') == 0) { print_unescaped('<span class="view_details" id="task_details_link" >'); print_unescaped('<form method="post" action="' . \OCP\Util::linkToRoute('collaboration_route', array('rel_path' => 'task_details')) . '" ><input type="hidden" name="tid" value="' . $_['details']['tid'] . '" /><a>' . $l->t('View Details') . '</a></form>'); print_unescaped('</span>'); } } } ?> </div> </div> <div id="comments" > <?php foreach ($_['comments'] as $comment) { if (!isset($comment['comment_id']) || $comment['comment_id'] == '') { break; } print_unescaped('<div class="comment" id="comment_' . $comment['comment_id'] . '" >');
<?php /** * Copyright (c) 2014 - Arno van Rossum <*****@*****.**> * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ OCP\App::checkAppEnabled('ocusagecharts'); OCP\App::setActiveNavigationEntry('ocusagecharts'); OCP\App::addNavigationEntry(array('id' => 'ocusagecharts', 'order' => 60, 'href' => \OCP\Util::linkToRoute('ocusagecharts.chart.frontpage'), 'icon' => OCP\Util::imagePath('ocusagecharts', 'iconchart.png'), 'name' => \OC_L10N::get('ocusagecharts')->t('ocUsageCharts'))); \OCP\Util::addStyle('ocusagecharts', 'style'); \OCP\Backgroundjob::registerJob('OCA\\ocUsageCharts\\Command\\UpdateChartsCommand');
/** * @param string $messageId * @param $accountId * @param $folderId * @return callable */ private function enrichDownloadUrl($accountId, $folderId, $messageId, $attachment) { $downloadUrl = \OCP\Util::linkToRoute('mail.messages.downloadAttachment', ['accountId' => $accountId, 'folderId' => $folderId, 'messageId' => $messageId, 'attachmentId' => $attachment['id']]); $downloadUrl = \OC::$server->getURLGenerator()->getAbsoluteURL($downloadUrl); $attachment['downloadUrl'] = $downloadUrl; $attachment['mimeUrl'] = $this->mimeTypeDetector->mimeTypeIcon($attachment['mime']); if ($this->attachmentIsImage($attachment)) { $attachment['isImage'] = true; } return $attachment; }