Exemplo n.º 1
0
function XY_Include($action)
{
    $templateFilePath = '';
    $Block = '';
    $startStr = '';
    $endStr = '';
    $content = '';
    $templateFilePath = lCase(RParam($action, 'File'));
    $Block = lCase(RParam($action, 'Block'));
    $findstr = '';
    $replaceStr = '';
    //查找字符,替换字符
    $findstr = moduleFindContent($action, 'findstr');
    //先找块
    $replaceStr = moduleFindContent($action, 'replacestr');
    //先找块
    $templateFilePath = handleFileUrl($templateFilePath);
    //处理文件路径
    if (CheckFile($templateFilePath) == false) {
        $templateFilePath = $GLOBALS['webTemplate'] . $templateFilePath;
    }
    $content = getFText($templateFilePath);
    if ($Block != '') {
        $startStr = '<!--#' . $Block . ' start#-->';
        $endStr = '<!--#' . $Block . ' end#-->';
        if (inStr($content, $startStr) > 0 && inStr($content, $endStr) > 0) {
            $content = StrCut($content, $startStr, $endStr, 2);
        }
    }
    //替换读出来的内容
    if ($findstr != '') {
        $content = replace($content, $findstr, $replaceStr);
    }
    $XY_Include = $content;
    return @$XY_Include;
}
Exemplo n.º 2
0
function getDefaultValue($action)
{
    $getDefaultValue = moduleFindContent($action, 'default');
    return @$getDefaultValue;
}
Exemplo n.º 3
0
function XY_ReadColumeSetTitle($action)
{
    $startStr = '';
    $endStr = '';
    $Style = '';
    $title = '';
    $valueStr = '';
    $MoreClass = '';
    $MoreUrl = '';
    $MoreStr = '';
    $aStr = '';
    $c = '';
    $action = HandleInModule($action, 'start');
    $Style = RParam($action, 'style');
    $title = RParam($action, 'Title');
    //Call Echo("ContentHeight",ContentHeight)
    //ValueStr = RParam(Action,"value")
    //根据模块找内容
    $valueStr = moduleFindContent($action, 'value');
    //Call Eerr("ValueStr",ValueStr)
    $valueStr = findModuleStr($GLOBALS['code'], $valueStr);
    //找模块对应内容
    $MoreClass = RParam($action, 'MoreClass');
    $MoreUrl = PHPTrim(RParam($action, 'MoreUrl'));
    $MoreStr = RParam($action, 'MoreStr');
    $valueStr = HandleInModule($valueStr, 'end');
    $c = readColumeSetTitle($action, $Style, $title, $valueStr);
    if ($MoreClass == '') {
        $MoreClass = 'more';
    }
    //More链接为空 则用默认代替
    //If MoreUrl="" Then MoreUrl="#"                    'More链接网址为空 则用默认#代替
    //More链接样式不能为空,因为没有样式它就不能让More在最近边
    if ($MoreUrl != '' && $MoreStr != '') {
        //AStr = "<a href='"& MoreUrl &"' class='"& MoreClass &"'>"& MoreStr &"</a>"
        $aStr = '<a ' . aHref($MoreUrl, $title, '') . ' class=\'' . $MoreClass . '\'>' . $MoreStr . '</a>';
        $c = replace($c, '<!--#AMore#-->', $aStr);
    }
    $XY_ReadColumeSetTitle = $c;
    return @$XY_ReadColumeSetTitle;
}