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


PHP Templates::getDir方法代码示例

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


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

示例1: basename

     }
     break;
 case 'uploadTemplate':
     $filetype = $this->params['type'];
     $filetitle = $this->params['title'];
     if ($_FILES['Filedata']['tmp_name']) {
         $fileTmpName = $_FILES['Filedata']['tmp_name'];
         $filename = basename($_FILES['Filedata']['name']);
     } else {
         $fileTmpName = fixAndMovePLUploads();
         $filename = basename($_REQUEST['name']);
     }
     $filesize = filesize($fileTmpName);
     $uploadID = $this->params['uploadID'];
     $templateid = $this->params['fileID'];
     $templatedir = $templateMgr->getDir();
     $window_id = $this->params['winID'];
     $timestamp = (int) $this->params['timestamp'];
     // Output something (needed for Flash-Player Mac)
     echo " ";
     while (@ob_end_flush()) {
     }
     $alreadyExists = false;
     if (file_exists($templatedir . $filename)) {
         $templateInfo = $templateMgr->getTemplate($templateid);
         if ($filename != $templateInfo['FILENAME']) {
             $alreadyExists = true;
         }
     }
     if (!file_exists($templatedir) || !is_writable($templatedir) || $alreadyExists) {
         $koala->queueScript("window.hadUploadError = true;");
开发者ID:nrueckmann,项目名称:yeager,代码行数:31,代码来源:templates.php

示例2: renderPage

function renderPage($page, $version, $pageInfo, $pageMgr, $siteInfo)
{
    $templateMgr = new Templates();
    $pageID = $pageInfo["OBJECTID"];
    $templateInfo = $templateMgr->getTemplate($pageInfo["TEMPLATEID"]);
    $templatefilename = $templateInfo["FILENAME"];
    $templatefullpath = $templateMgr->getDir() . $templateInfo["PATH"] . $templatefilename;
    $content = $page->getContent();
    // navi
    $tree = $pageMgr->getList($pageID, array($filter));
    $tree = $pageMgr->getAdditionalTreeInfo($pageID, $tree, true);
    $oldlevel = 0;
    for ($xt = 0; $xt < count($tree); $xt++) {
        if ($oldlevel != $tree[$xt]["LEVEL"] || !$pnames) {
            $tree[$xt]["PARENTS"] = $pnames = $pageMgr->getParents($tree[$xt]["ID"]);
            $oldlevel = $tree[$xt]["LEVEL"];
        } else {
            $tree[$xt]["PARENTS"] = $pnames;
        }
        if ($pageID == $tree[$xt]["ID"]) {
            $pageInfo["PARENTS"] = $pnames;
        }
        $url = "";
        $pi = count($pnames);
        while ($pi > 0) {
            $url .= $pnames[$pi - 1][0]["PNAME"] . "/";
            $pi--;
        }
        $tree[$xt]["PURL"] = $url . $tree[$xt]["PNAME"] . "/";
        $tree[$xt]["URL"] = sApp()->webroot . $url . $tree[$xt]["PNAME"] . "/";
        if ($tree[$xt]["HIDDEN"] == 0 && $tree[$xt]["SHOW"] == 1) {
            $xtc = $xtc + 1;
        }
    }
    $pageMgr->callExtensionHook("onRender", $siteInfo["ID"], $pageID, $version, array("FILTER" => $filter, "CONTENTAREAS" => &$content));
    // Fill userinfo with data from current user
    $currUser = new User(sUserMgr()->getCurrentUserID());
    $userInfo = $currUser->get();
    $userInfo['FULLNAME'] = trim($userInfo['FIRSTNAME'] . ' ' . $userInfo['LASTNAME']);
    sApp()->smarty->assign("user", $userInfo);
    sApp()->smarty->assign("devmode", (string) sApp()->devmode);
    sApp()->smarty->assign("pageinfo", $pageInfo);
    sApp()->smarty->assign("contentareas", $content);
    sApp()->smarty->assign("tree", $tree);
    sApp()->smarty->assign("site", $siteInfo["ID"]);
    sApp()->smarty->assign("siteinfo", $siteInfo);
    sApp()->smarty->assign("sitename", $siteInfo["PNAME"]);
    sApp()->smarty->assign("untitledparams", sApp()->request->untitled_parameters);
    if (!sApp()->output_tmp) {
        if ($templateInfo == NULL) {
            sApp()->output_tmp = "";
        } else {
            sApp()->output_tmp = sApp()->smarty->fetch("file:" . $templatefullpath);
        }
    }
    //2nd pass
    sApp()->smarty->left_delimiter = '[!';
    sApp()->smarty->right_delimiter = '!]';
    sApp()->output = sApp()->smarty->fetch("var:" . sApp()->output_tmp);
    //3rd pass (replace special urls with normal urls)
    sApp()->output = replaceSpecialURLs(sApp()->output);
    echo sApp()->output;
}
开发者ID:nrueckmann,项目名称:yeager,代码行数:63,代码来源:page_render.inc.php

示例3: Templates

        $mailingVersion = $mailing->getPublishedVersion(true);
    }
} else {
    $filter = "PUBLISHED";
    $mailingVersion = $mailing->getPublishedVersion(true);
}
$mailing = $mailingMgr->getMailing($mailingId, $mailingVersion);
// Mailing Properties
$mailingInfo = $mailing->get();
$mailingProperties = $mailing->properties->get();
$mailingInfo = array_merge($mailingProperties, $mailingInfo);
// Template
$templateMgr = new Templates();
$templateInfo = $templateMgr->getTemplate($mailingInfo['TEMPLATEID']);
$templatefilename = $templateInfo['FILENAME'];
$templatefullpath = $templateMgr->getDir() . $templateInfo['PATH'] . $templatefilename;
// Content
$content = $mailing->getContent();
$mailingcnt = array('USERINFO' => $userInfo, 'FILTER' => $filter, 'CONTENTAREAS' => &$content);
$mailingMgr->callExtensionHook('onRender', $mailingId, $mailingVersion, $mailingcnt);
sSmarty()->assign('pageinfo', $mailingInfo);
sSmarty()->assign('contentareas', $content);
if (!$output_tmp) {
    $output_tmp = sSmarty()->fetch('file:' . $templatefullpath);
}
// 2nd pass
sSmarty()->left_delimiter = '[!';
sSmarty()->right_delimiter = '!]';
sApp()->output = sSmarty()->fetch('var:' . $output_tmp);
// 3rd pass (replace special urls with normal urls)
sApp()->output = replaceSpecialURLs(sApp()->output, true);
开发者ID:nrueckmann,项目名称:yeager,代码行数:31,代码来源:mailing.php


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