当前位置: 首页>>代码示例>>PHP>>正文


PHP OC_Template::fetchPage方法代码示例

本文整理汇总了PHP中OC_Template::fetchPage方法的典型用法代码示例。如果您正苦于以下问题:PHP OC_Template::fetchPage方法的具体用法?PHP OC_Template::fetchPage怎么用?PHP OC_Template::fetchPage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在OC_Template的用法示例。


在下文中一共展示了OC_Template::fetchPage方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: sendEmail

 public static function sendEmail($args)
 {
     if (OC_User::userExists($_POST['user'])) {
         $token = hash('sha256', OC_Util::generate_random_bytes(30) . OC_Config::getValue('passwordsalt', ''));
         OC_Preferences::setValue($_POST['user'], 'owncloud', 'lostpassword', hash('sha256', $token));
         // Hash the token again to prevent timing attacks
         $email = OC_Preferences::getValue($_POST['user'], 'settings', 'email', '');
         if (!empty($email)) {
             $link = OC_Helper::linkToRoute('core_lostpassword_reset', array('user' => $_POST['user'], 'token' => $token));
             $link = OC_Helper::makeURLAbsolute($link);
             $tmpl = new OC_Template('core/lostpassword', 'email');
             $tmpl->assign('link', $link, false);
             $msg = $tmpl->fetchPage();
             $l = OC_L10N::get('core');
             $from = 'lostpassword-noreply@' . OCP\Util::getServerHost();
             OC_Mail::send($email, $_POST['user'], $l->t('ownCloud password reset'), $msg, $from, 'ownCloud');
             echo 'Mailsent';
             self::displayLostPasswordPage(false, true);
         } else {
             self::displayLostPasswordPage(true, false);
         }
     } else {
         self::displayLostPasswordPage(true, false);
     }
 }
开发者ID:ryanshoover,项目名称:core,代码行数:25,代码来源:controller.php

示例2: sendEmail

 public static function sendEmail($args)
 {
     $isEncrypted = OC_App::isEnabled('files_encryption');
     if (!$isEncrypted || isset($_POST['continue'])) {
         $continue = true;
     } else {
         $continue = false;
     }
     if (OC_User::userExists($_POST['user']) && $continue) {
         $token = hash('sha256', OC_Util::generate_random_bytes(30) . OC_Config::getValue('passwordsalt', ''));
         OC_Preferences::setValue($_POST['user'], 'owncloud', 'lostpassword', hash('sha256', $token));
         // Hash the token again to prevent timing attacks
         $email = OC_Preferences::getValue($_POST['user'], 'settings', 'email', '');
         if (!empty($email)) {
             $link = OC_Helper::linkToRoute('core_lostpassword_reset', array('user' => $_POST['user'], 'token' => $token));
             $link = OC_Helper::makeURLAbsolute($link);
             $tmpl = new OC_Template('core/lostpassword', 'email');
             $tmpl->assign('link', $link, false);
             $msg = $tmpl->fetchPage();
             $l = OC_L10N::get('core');
             $from = OCP\Util::getDefaultEmailAddress('lostpassword-noreply');
             try {
                 OC_Mail::send($email, $_POST['user'], $l->t('ownCloud password reset'), $msg, $from, 'ownCloud');
             } catch (Exception $e) {
                 OC_Template::printErrorPage('A problem occurs during sending the e-mail please contact your administrator.');
             }
             self::displayLostPasswordPage(false, true);
         } else {
             self::displayLostPasswordPage(true, false);
         }
     } else {
         self::displayLostPasswordPage(true, false);
     }
 }
开发者ID:CDN-Sparks,项目名称:owncloud,代码行数:34,代码来源:controller.php

示例3: av_scan

 public static function av_scan($path)
 {
     $path = $path[\OC\Files\Filesystem::signal_param_path];
     if ($path != '') {
         $files_view = \OCP\Files::getStorage("files");
         if ($files_view->file_exists($path)) {
             $root = OC_User::getHome(OC_User::getUser()) . '/files';
             $file = $root . $path;
             $result = self::clamav_scan($file);
             switch ($result) {
                 case CLAMAV_SCANRESULT_UNCHECKED:
                     //TODO: Show warning to the user: The file can not be checked
                     break;
                 case CLAMAV_SCANRESULT_INFECTED:
                     //remove file
                     $files_view->unlink($path);
                     OCP\JSON::error(array("data" => array("message" => "Virus detected! Can't upload the file.")));
                     $email = OC_Preferences::getValue(OC_User::getUser(), 'settings', 'email', '');
                     \OCP\Util::writeLog('files_antivirus', 'Email: ' . $email, \OCP\Util::DEBUG);
                     if (!empty($email)) {
                         $tmpl = new OC_Template('files_antivirus', 'notification');
                         $tmpl->assign('file', $path);
                         $tmpl->assign('host', OCP\Util::getServerHost());
                         $tmpl->assign('user', OC_User::getUser());
                         $msg = $tmpl->fetchPage();
                         $from = OCP\Util::getDefaultEmailAddress('security-noreply');
                         OCP\Util::sendMail($email, OC_User::getUser(), 'Malware detected', $msg, $from, 'ownCloud', 1);
                     }
                     exit;
                     break;
                 case CLAMAV_SCANRESULT_CLEAN:
                     //do nothing
                     break;
             }
         }
     }
 }
开发者ID:CDN-Sparks,项目名称:owncloud,代码行数:37,代码来源:clamav.php

示例4: createMailBody

 /**
  * create mail body for plain text and html mail
  *
  * @param string $filename the shared file
  * @param string $link link to the shared file
  * @param int $expiration expiration date (timestamp)
  * @param string $prefix prefix of mail template files
  * @return array an array of the html mail body and the plain text mail body
  */
 private function createMailBody($filename, $link, $expiration, $prefix = '')
 {
     $formattedDate = $expiration ? $this->l->l('date', $expiration) : null;
     $html = new \OC_Template('core', $prefix . 'mail', '');
     $html->assign('link', $link);
     $html->assign('user_displayname', $this->senderDisplayName);
     $html->assign('filename', $filename);
     $html->assign('expiration', $formattedDate);
     $htmlMail = $html->fetchPage();
     $plainText = new \OC_Template('core', $prefix . 'altmail', '');
     $plainText->assign('link', $link);
     $plainText->assign('user_displayname', $this->senderDisplayName);
     $plainText->assign('filename', $filename);
     $plainText->assign('expiration', $formattedDate);
     $plainTextMail = $plainText->fetchPage();
     return [$htmlMail, $plainTextMail];
 }
开发者ID:Commenter123,项目名称:core,代码行数:26,代码来源:mailnotifications.php

示例5: array

$breadcrumb = array();
$pathtohere = "";
foreach (explode("/", $dir) as $i) {
    if ($i != "") {
        $pathtohere .= "/" . str_replace('+', '%20', urlencode($i));
        $breadcrumb[] = array("dir" => $pathtohere, "name" => $i);
    }
}
// make breadcrumb und filelist markup
$list = new OC_Template("files", "part.list", "");
$list->assign("files", $files);
$list->assign("baseURL", OC_Helper::linkTo("files", "index.php") . "?dir=");
$list->assign("downloadURL", OC_Helper::linkTo("files", "download.php") . "?file=");
$breadcrumbNav = new OC_Template("files", "part.breadcrumb", "");
$breadcrumbNav->assign("breadcrumb", $breadcrumb);
$breadcrumbNav->assign("baseURL", OC_Helper::linkTo("files", "index.php") . "?dir=");
$upload_max_filesize = OC_Helper::computerFileSize(ini_get('upload_max_filesize'));
$post_max_size = OC_Helper::computerFileSize(ini_get('post_max_size'));
$maxUploadFilesize = min($upload_max_filesize, $post_max_size);
$freeSpace = OC_Filesystem::free_space('/');
$freeSpace = max($freeSpace, 0);
$maxUploadFilesize = min($maxUploadFilesize, $freeSpace);
$tmpl = new OC_Template("files", "index", "user");
$tmpl->assign("fileList", $list->fetchPage());
$tmpl->assign("breadcrumb", $breadcrumbNav->fetchPage());
$tmpl->assign('dir', $dir);
$tmpl->assign('readonly', !OC_Filesystem::is_writable($dir));
$tmpl->assign("files", $files);
$tmpl->assign('uploadMaxFilesize', $maxUploadFilesize);
$tmpl->assign('uploadMaxHumanFilesize', OC_Helper::humanFileSize($maxUploadFilesize));
$tmpl->printPage();
开发者ID:shimogapradeep,项目名称:acceptance-testing,代码行数:31,代码来源:Demo+Code+-+PHP.php

示例6: sendEmail

 /**
  * @param string $user
  * @throws \Exception
  */
 protected function sendEmail($user)
 {
     if (!$this->userManager->userExists($user)) {
         throw new \Exception($this->l10n->t('Couldn\'t send reset email. Please make sure your username is correct.'));
     }
     $email = $this->config->getUserValue($user, 'settings', 'email');
     if (empty($email)) {
         throw new \Exception($this->l10n->t('Couldn\'t send reset email because there is no ' . 'email address for this username. Please ' . 'contact your administrator.'));
     }
     $token = $this->secureRandom->getMediumStrengthGenerator()->generate(21, ISecureRandom::CHAR_DIGITS . ISecureRandom::CHAR_LOWER . ISecureRandom::CHAR_UPPER);
     $this->config->setUserValue($user, 'owncloud', 'lostpassword', $token);
     $link = $this->urlGenerator->linkToRouteAbsolute('core.lost.resetform', array('userId' => $user, 'token' => $token));
     $tmpl = new \OC_Template('core/lostpassword', 'email');
     $tmpl->assign('link', $link, false);
     $msg = $tmpl->fetchPage();
     try {
         $message = $this->mailer->createMessage();
         $message->setTo([$email => $user]);
         $message->setSubject($this->l10n->t('%s password reset', [$this->defaults->getName()]));
         $message->setPlainBody($msg);
         $message->setFrom([$this->from => $this->defaults->getName()]);
         $this->mailer->send($message);
     } catch (\Exception $e) {
         throw new \Exception($this->l10n->t('Couldn\'t send reset email. Please contact your administrator.'));
     }
 }
开发者ID:Kevin-ZK,项目名称:vaneDisk,代码行数:30,代码来源:lostcontroller.php

示例7: rand

 * See the COPYING-README file.
*/
$RUNTIME_NOAPPS = TRUE;
//no apps
require_once '../../lib/base.php';
// Someone lost their password:
if (isset($_POST['user'])) {
    if (OC_User::userExists($_POST['user'])) {
        $token = sha1($_POST['user'] . md5(uniqid(rand(), true)));
        OC_Preferences::setValue($_POST['user'], 'owncloud', 'lostpassword', $token);
        $email = OC_Preferences::getValue($_POST['user'], 'settings', 'email', '');
        if (!empty($email) and isset($_POST['sectoken']) and isset($_SESSION['sectoken']) and $_POST['sectoken'] == $_SESSION['sectoken']) {
            $link = OC_Helper::linkToAbsolute('core/lostpassword', 'resetpassword.php') . '?user=' . $_POST['user'] . '&token=' . $token;
            $tmpl = new OC_Template('core/lostpassword', 'email');
            $tmpl->assign('link', $link);
            $msg = $tmpl->fetchPage();
            $l = OC_L10N::get('core');
            $from = 'lostpassword-noreply@' . OC_Helper::serverHost();
            OC_MAIL::send($email, $_POST['user'], $l->t('ownCloud password reset'), $msg, $from, 'ownCloud');
            echo 'sent';
        }
        $sectoken = rand(1000000, 9999999);
        $_SESSION['sectoken'] = $sectoken;
        OC_Template::printGuestPage('core/lostpassword', 'lostpassword', array('error' => false, 'requested' => true, 'sectoken' => $sectoken));
    } else {
        $sectoken = rand(1000000, 9999999);
        $_SESSION['sectoken'] = $sectoken;
        OC_Template::printGuestPage('core/lostpassword', 'lostpassword', array('error' => true, 'requested' => false, 'sectoken' => $sectoken));
    }
} else {
    $sectoken = rand(1000000, 9999999);
开发者ID:jaeindia,项目名称:ownCloud-Enhancements,代码行数:31,代码来源:index.php

示例8: sendEmail

 protected function sendEmail($user, $proceed)
 {
     if ($this->isDataEncrypted && !$proceed) {
         throw new EncryptedDataException();
     }
     if (!$this->userManager->userExists($user)) {
         throw new \Exception($this->l10n->t('Couldn\'t send reset email. Please make sure ' . 'your username is correct.'));
     }
     $token = hash('sha256', \OC_Util::generateRandomBytes(30));
     // Hash the token again to prevent timing attacks
     $this->config->setUserValue($user, 'owncloud', 'lostpassword', hash('sha256', $token));
     $email = $this->config->getUserValue($user, 'settings', 'email');
     if (empty($email)) {
         throw new \Exception($this->l10n->t('Couldn\'t send reset email because there is no ' . 'email address for this username. Please ' . 'contact your administrator.'));
     }
     $link = $this->getLink('core.lost.resetform', $user, $token);
     $tmpl = new \OC_Template('core/lostpassword', 'email');
     $tmpl->assign('link', $link, false);
     $msg = $tmpl->fetchPage();
     try {
         // FIXME: should be added to the container and injected in here
         \OC_Mail::send($email, $user, $this->l10n->t('%s password reset', array($this->defaults->getName())), $msg, $this->from, $this->defaults->getName());
     } catch (\Exception $e) {
         throw new \Exception($this->l10n->t('Couldn\'t send reset email. Please contact your administrator.'));
     }
 }
开发者ID:WYSAC,项目名称:oregon-owncloud,代码行数:26,代码来源:lostcontroller.php

示例9:

<?php

/**
* ownCloud - Cloudpress
*
* @author Bastien Ho (EELV - Urbancube)
* @copyleft 2012 bastienho@urbancube.fr
* @projeturl http://ecolosites.eelv.fr
*
* Free Software under creative commons licence
* http://creativecommons.org/licenses/by-nc/3.0/
* Attribution-NonCommercial 3.0 Unported (CC BY-NC 3.0)
* 
* You are free:
* to Share — to copy, distribute and transmit the work
* to Remix — to adapt the work
*
* Under the following conditions:
* Attribution — You must attribute the work in the manner specified by the author or licensor (but not in any way that
* suggests  that they endorse you or your use of the work).
* Noncommercial — You may not use this work for commercial purposes.
*
*/
$wp_instance = new OC_wordpress();
// fill template
$tmpl = new OC_Template('user_wordpress', 'settings');
foreach ($wp_instance->params as $param => $value) {
    $tmpl->assign($param, $value);
}
return $tmpl->fetchPage();
开发者ID:silvioheinze,项目名称:user_wordpress,代码行数:30,代码来源:settings.php

示例10: array

            // enable l10n support
            $l = OC_L10N::get('core');
            // setup the email
            $subject = (string) $l->t('%s shared »%s« with you', array($displayName, $file));
            $content = new OC_Template("core", "mail", "");
            $content->assign('link', $link);
            $content->assign('type', $type);
            $content->assign('user_displayname', $displayName);
            $content->assign('filename', $file);
            $text = $content->fetchPage();
            $content = new OC_Template("core", "altmail", "");
            $content->assign('link', $link);
            $content->assign('type', $type);
            $content->assign('user_displayname', $displayName);
            $content->assign('filename', $file);
            $alttext = $content->fetchPage();
            $default_from = OCP\Util::getDefaultEmailAddress('sharing-noreply');
            $from_address = OCP\Config::getUserValue($user, 'settings', 'email', $default_from);
            // send it out now
            try {
                OCP\Util::sendMail($to_address, $to_address, $subject, $text, $from_address, $displayName, 1, $alttext);
                OCP\JSON::success();
            } catch (Exception $exception) {
                OCP\JSON::error(array('data' => array('message' => OC_Util::sanitizeHTML($exception->getMessage()))));
            }
            break;
    }
} else {
    if (isset($_GET['fetch'])) {
        switch ($_GET['fetch']) {
            case 'getItemsSharedStatuses':
开发者ID:omusico,项目名称:isle-web-framework,代码行数:31,代码来源:share.php

示例11: printExceptionErrorPage

 /**
  * print error page using Exception details
  * @param Exception | Throwable $exception
  */
 public static function printExceptionErrorPage($exception, $fetchPage = false)
 {
     try {
         $request = \OC::$server->getRequest();
         $content = new \OC_Template('', 'exception', 'error', false);
         $content->assign('errorClass', get_class($exception));
         $content->assign('errorMsg', $exception->getMessage());
         $content->assign('errorCode', $exception->getCode());
         $content->assign('file', $exception->getFile());
         $content->assign('line', $exception->getLine());
         $content->assign('trace', $exception->getTraceAsString());
         $content->assign('debugMode', \OC::$server->getSystemConfig()->getValue('debug', false));
         $content->assign('remoteAddr', $request->getRemoteAddress());
         $content->assign('requestID', $request->getId());
         if ($fetchPage) {
             return $content->fetchPage();
         }
         $content->printPage();
     } catch (\Exception $e) {
         $logger = \OC::$server->getLogger();
         $logger->logException($exception, ['app' => 'core']);
         $logger->logException($e, ['app' => 'core']);
         header(self::getHttpProtocol() . ' 500 Internal Server Error');
         header('Content-Type: text/plain; charset=utf-8');
         print "Internal Server Error\n\n";
         print "The server encountered an internal error and was unable to complete your request.\n";
         print "Please contact the server administrator if this error reappears multiple times, please include the technical details below in your report.\n";
         print "More details can be found in the server log.\n";
     }
     die;
 }
开发者ID:GitHubUser4234,项目名称:core,代码行数:35,代码来源:template.php

示例12: array

             $pathtohere .= "/{$i}";
             $breadcrumb[] = array("dir" => $pathtohere, "name" => $i);
         }
     }
     // Load the files we need
     OC_Util::addStyle("files", "files");
     $breadcrumbNav = new OC_Template("files", "part.breadcrumb", "");
     $breadcrumbNav->assign("breadcrumb", $breadcrumb);
     $breadcrumbNav->assign("baseURL", OC_Helper::linkTo("files_sharing", "get.php") . "?token=" . $token . "&path=");
     $list = new OC_Template("files", "part.list", "");
     $list->assign("files", $files);
     $list->assign("baseURL", OC_Helper::linkTo("files_sharing", "get.php") . "?token=" . $token . "&path=");
     $list->assign("downloadURL", OC_Helper::linkTo("files_sharing", "get.php") . "?token=" . $token . "&path=");
     $list->assign("readonly", true);
     $tmpl = new OC_Template("files", "index", "user");
     $tmpl->assign("fileList", $list->fetchPage());
     $tmpl->assign("breadcrumb", $breadcrumbNav->fetchPage());
     $tmpl->assign("readonly", true);
     $tmpl->printPage();
 } else {
     //get time mimetype and set the headers
     $mimetype = OC_Filesystem::getMimeType($source);
     header("Content-Transfer-Encoding: binary");
     header("Expires: 0");
     header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
     header("Pragma: public");
     header('Content-Disposition: filename="' . basename($source) . '"');
     header("Content-Type: " . $mimetype);
     header("Content-Length: " . OC_Filesystem::filesize($source));
     //download the file
     @ob_clean();
开发者ID:Teino1978-Corp,项目名称:Teino1978-Corp-owncloud_.htaccess-,代码行数:31,代码来源:owncloud_apps_files_sharing_get.php

示例13:

<?php

/**
 * Copyright (c) 2011 Bart Visscher <bartv@thisnet.nl>
 * This file is licensed under the Affero General Public License version 3 or
 * later.
 * See the COPYING-README file.
 */
require_once '../../../lib/base.php';
$l10n = new OC_L10N('calendar');
// Check if we are a user
OC_JSON::checkLoggedIn();
OC_JSON::checkAppEnabled('calendar');
$userid = OC_User::getUser();
$calendarid = OC_Calendar_Calendar::addCalendar($userid, $_POST['name'], 'VEVENT,VTODO,VJOURNAL', null, 0, $_POST['color']);
OC_Calendar_Calendar::setCalendarActive($calendarid, 1);
$calendar = OC_Calendar_Calendar::findCalendar($calendarid);
$tmpl = new OC_Template('calendar', 'part.choosecalendar.rowfields');
$tmpl->assign('calendar', $calendar);
OC_JSON::success(array('data' => $tmpl->fetchPage()));
开发者ID:Teino1978-Corp,项目名称:Teino1978-Corp-owncloud_.htaccess-,代码行数:20,代码来源:owncloud_apps_calendar_ajax_createcalendar.php

示例14: fetchPage

 /**
  * @brief Proceeds the template
  * @returns content
  *
  * This function proceeds the template. If $this->renderas is set, it will
  * will produce a full page.
  */
 public function fetchPage()
 {
     $data = $this->_fetch();
     if ($this->renderas) {
         // Decide which page we show
         if ($this->renderas == "user") {
             $page = new OC_Template("core", "layout.user");
             $page->assign('searchurl', OC_Helper::linkTo('search', 'index.php'));
             if (array_search(OC_APP::getCurrentApp(), array('settings', 'admin', 'help')) !== false) {
                 $page->assign('bodyid', 'body-settings');
             } else {
                 $page->assign('bodyid', 'body-user');
             }
             // Add navigation entry
             $page->assign("navigation", OC_App::getNavigation());
             $page->assign("settingsnavigation", OC_App::getSettingsNavigation());
         } else {
             $page = new OC_Template("core", "layout.guest");
         }
         // Add the css and js files
         foreach (OC_Util::$scripts as $script) {
             if (is_file(OC::$SERVERROOT . "/apps/{$script}.js")) {
                 $page->append("jsfiles", OC::$WEBROOT . "/apps/{$script}.js");
             } elseif (is_file(OC::$SERVERROOT . "/{$script}.js")) {
                 $page->append("jsfiles", OC::$WEBROOT . "/{$script}.js");
             } else {
                 $page->append("jsfiles", OC::$WEBROOT . "/core/{$script}.js");
             }
         }
         foreach (OC_Util::$styles as $style) {
             if (is_file(OC::$SERVERROOT . "/apps/{$style}.css")) {
                 $page->append("cssfiles", OC::$WEBROOT . "/apps/{$style}.css");
             } elseif (is_file(OC::$SERVERROOT . "/{$style}.css")) {
                 $page->append("cssfiles", OC::$WEBROOT . "/{$style}.css");
             } else {
                 $page->append("cssfiles", OC::$WEBROOT . "/core/{$style}.css");
             }
         }
         // Add custom headers
         $page->assign('headers', $this->headers);
         foreach (OC_Util::$headers as $header) {
             $page->append('headers', $header);
         }
         // Add css files and js files
         $page->assign("content", $data);
         return $page->fetchPage();
     } else {
         return $data;
     }
 }
开发者ID:Teino1978-Corp,项目名称:Teino1978-Corp-owncloud_.htaccess-,代码行数:57,代码来源:owncloud_lib_template.php

示例15: fetchPage

 /**
  * @brief Proceeds the template
  * @returns content
  *
  * This function proceeds the template. If $this->renderas is set, it
  * will produce a full page.
  */
 public function fetchPage()
 {
     $data = $this->_fetch();
     if ($this->renderas) {
         // Decide which page we show
         if ($this->renderas == "user") {
             $page = new OC_Template("core", "layout.user");
             $page->assign('searchurl', OC_Helper::linkTo('search', 'index.php'));
             if (array_search(OC_APP::getCurrentApp(), array('settings', 'admin', 'help')) !== false) {
                 $page->assign('bodyid', 'body-settings');
             } else {
                 $page->assign('bodyid', 'body-user');
             }
             // Add navigation entry
             $navigation = OC_App::getNavigation();
             $page->assign("navigation", $navigation);
             $page->assign("settingsnavigation", OC_App::getSettingsNavigation());
             foreach ($navigation as $entry) {
                 if ($entry['active']) {
                     $page->assign('application', $entry['name']);
                     break;
                 }
             }
         } else {
             $page = new OC_Template("core", "layout.guest");
         }
         // Read the selected theme from the config file
         $theme = OC_Config::getValue("theme");
         // Read the detected formfactor and use the right file name.
         $fext = $this->getFormFactorExtension();
         // Add the core js files or the js files provided by the selected theme
         foreach (OC_Util::$scripts as $script) {
             // Is it in 3rd party?
             if ($page->appendIfExist('jsfiles', OC::$THIRDPARTYROOT, OC::$THIRDPARTYWEBROOT, $script . '.js')) {
                 // Is it in apps and overwritten by the theme?
             } elseif ($page->appendIfExist('jsfiles', OC::$SERVERROOT, OC::$WEBROOT, "themes/{$theme}/apps/{$script}{$fext}.js")) {
             } elseif ($page->appendIfExist('jsfiles', OC::$SERVERROOT, OC::$WEBROOT, "themes/{$theme}/apps/{$script}.js")) {
                 // Is it part of an app?
             } elseif ($page->appendIfExist('jsfiles', OC::$APPSROOT, OC::$APPSWEBROOT, "apps/{$script}{$fext}.js")) {
             } elseif ($page->appendIfExist('jsfiles', OC::$APPSROOT, OC::$APPSWEBROOT, "apps/{$script}.js")) {
                 // Is it in the owncloud root but overwritten by the theme?
             } elseif ($page->appendIfExist('jsfiles', OC::$SERVERROOT, OC::$WEBROOT, "themes/{$theme}/{$script}{$fext}.js")) {
             } elseif ($page->appendIfExist('jsfiles', OC::$SERVERROOT, OC::$WEBROOT, "themes/{$theme}/{$script}.js")) {
                 // Is it in the owncloud root ?
             } elseif ($page->appendIfExist('jsfiles', OC::$SERVERROOT, OC::$WEBROOT, "{$script}{$fext}.js")) {
             } elseif ($page->appendIfExist('jsfiles', OC::$SERVERROOT, OC::$WEBROOT, "{$script}.js")) {
                 // Is in core but overwritten by a theme?
             } elseif ($page->appendIfExist('jsfiles', OC::$SERVERROOT, OC::$WEBROOT, "themes/{$theme}/core/{$script}{$fext}.js")) {
             } elseif ($page->appendIfExist('jsfiles', OC::$SERVERROOT, OC::$WEBROOT, "themes/{$theme}/core/{$script}.js")) {
                 // Is it in core?
             } elseif ($page->appendIfExist('jsfiles', OC::$SERVERROOT, OC::$WEBROOT, "core/{$script}{$fext}.js")) {
             } elseif ($page->appendIfExist('jsfiles', OC::$SERVERROOT, OC::$WEBROOT, "core/{$script}.js")) {
             } else {
                 echo 'js file not found: script:' . $script . ' formfactor:' . $fext . ' webroot:' . OC::$WEBROOT . ' serverroot:' . OC::$SERVERROOT;
                 die;
             }
         }
         // Add the css files
         foreach (OC_Util::$styles as $style) {
             // is it in 3rdparty?
             if ($page->appendIfExist('cssfiles', OC::$THIRDPARTYROOT, OC::$THIRDPARTYWEBROOT, $style . '.css')) {
                 // or in apps?
             } elseif ($page->appendIfExist('cssfiles', OC::$APPSROOT, OC::$APPSWEBROOT, "apps/{$style}{$fext}.css")) {
             } elseif ($page->appendIfExist('cssfiles', OC::$APPSROOT, OC::$APPSWEBROOT, "apps/{$style}.css")) {
                 // or in the owncloud root?
             } elseif ($page->appendIfExist('cssfiles', OC::$SERVERROOT, OC::$WEBROOT, "{$style}{$fext}.css")) {
             } elseif ($page->appendIfExist('cssfiles', OC::$SERVERROOT, OC::$WEBROOT, "{$style}.css")) {
                 // or in core ?
             } elseif ($page->appendIfExist('cssfiles', OC::$SERVERROOT, OC::$WEBROOT, "core/{$style}{$fext}.css")) {
             } elseif ($page->appendIfExist('cssfiles', OC::$SERVERROOT, OC::$WEBROOT, "core/{$style}.css")) {
             } else {
                 echo 'css file not found: style:' . $script . ' formfactor:' . $fext . ' webroot:' . OC::$WEBROOT . ' serverroot:' . OC::$SERVERROOT;
                 die;
             }
         }
         // Add the theme css files. you can override the default values here
         if (!empty($theme)) {
             foreach (OC_Util::$styles as $style) {
                 if ($page->appendIfExist('cssfiles', OC::$SERVERROOT, OC::$WEBROOT, "themes/{$theme}/apps/{$style}{$fext}.css")) {
                 } elseif ($page->appendIfExist('cssfiles', OC::$SERVERROOT, OC::$WEBROOT, "themes/{$theme}/apps/{$style}.css")) {
                 } elseif ($page->appendIfExist('cssfiles', OC::$SERVERROOT, OC::$WEBROOT, "themes/{$theme}/{$style}{$fext}.css")) {
                 } elseif ($page->appendIfExist('cssfiles', OC::$SERVERROOT, OC::$WEBROOT, "themes/{$theme}/{$style}.css")) {
                 } elseif ($page->appendIfExist('cssfiles', OC::$SERVERROOT, OC::$WEBROOT, "themes/{$theme}/core/{$style}{$fext}.css")) {
                 } elseif ($page->appendIfExist('cssfiles', OC::$SERVERROOT, OC::$WEBROOT, "themes/{$theme}/core/{$style}.css")) {
                 }
             }
         }
         // Add custom headers
         $page->assign('headers', $this->headers);
         foreach (OC_Util::$headers as $header) {
             $page->append('headers', $header);
         }
         // Add css files and js files
//.........这里部分代码省略.........
开发者ID:jaeindia,项目名称:ownCloud-Enhancements,代码行数:101,代码来源:template.php


注:本文中的OC_Template::fetchPage方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。