• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP isStandardTemplate函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中isStandardTemplate函数的典型用法代码示例。如果您正苦于以下问题:PHP isStandardTemplate函数的具体用法?PHP isStandardTemplate怎么用?PHP isStandardTemplate使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: db_upgrade_all

function db_upgrade_all($oldversion)
{
    /// This function does anything necessary to upgrade
    /// older versions to match current functionality
    global $modifyoutput, $dbprefix, $usertemplaterootdir, $standardtemplaterootdir, $clang;
    echo str_pad($clang->gT('The LimeSurvey database is being upgraded') . ' (' . date('Y-m-d H:i:s') . ')', 14096) . "." . $clang->gT('Please be patient...') . "<br /><br />\n";
    if ($oldversion < 143) {
        // Move all user templates to the new user template directory
        echo sprintf($clang->gT("Moving user templates to new location at %s..."), $usertemplaterootdir) . "<br />";
        $myDirectory = opendir($standardtemplaterootdir);
        $aFailedTemplates = array();
        // get each entry
        while ($entryName = readdir($myDirectory)) {
            if (!in_array($entryName, array('.', '..', '.svn')) && is_dir($standardtemplaterootdir . DIRECTORY_SEPARATOR . $entryName) && !isStandardTemplate($entryName)) {
                if (!rename($standardtemplaterootdir . DIRECTORY_SEPARATOR . $entryName, $usertemplaterootdir . DIRECTORY_SEPARATOR . $entryName)) {
                    $aFailedTemplates[] = $entryName;
                }
            }
        }
        if (count($aFailedTemplates) > 0) {
            echo "The following templates at {$standardtemplaterootdir} could not be moved to the new location at {$usertemplaterootdir}:<br /><ul>";
            foreach ($aFailedTemplates as $sFailedTemplate) {
                echo "<li>{$sFailedTemplate}</li>";
            }
            echo "</ul>Please move these templates manually after the upgrade has finished.<br />";
        }
        // close directory
        closedir($myDirectory);
    }
}
开发者ID:himanshu12k,项目名称:ce-www,代码行数:30,代码来源:upgrade-all.php


示例2: gettemplatelist

function gettemplatelist($usertemplaterootdir, $standardtemplates, $standardtemplaterootdir)
{
    #global $usertemplatierootdir, $standardtemplates,$standardtemplaterootdir;
    if (!$usertemplaterootdir) {
        die("gettemplatelist() no template directory");
    }
    if ($handle = opendir($standardtemplaterootdir)) {
        while (false !== ($file = readdir($handle))) {
            if (!is_file("{$standardtemplaterootdir}/{$file}") && $file != "." && $file != ".." && $file != ".svn" && isStandardTemplate($file)) {
                $list_of_files[$file] = $standardtemplaterootdir . DIRECTORY_SEPARATOR . $file;
            }
        }
        closedir($handle);
    }
    if ($handle = opendir($usertemplaterootdir)) {
        while (false !== ($file = readdir($handle))) {
            if (!is_file("{$usertemplaterootdir}/{$file}") && $file != "." && $file != ".." && $file != ".svn") {
                $list_of_files[$file] = $usertemplaterootdir . DIRECTORY_SEPARATOR . $file;
            }
        }
        closedir($handle);
    }
    if (!empty($list_of_files)) {
        ksort($list_of_files);
    }
    return $list_of_files;
}
开发者ID:himanshu12k,项目名称:ce-www,代码行数:27,代码来源:admin_functions_ci.php


示例3: templaterename

 /**
  * Function responsible to rename a template(folder).
  *
  * @access public
  * @return void
  */
 public function templaterename()
 {
     if (!Permission::model()->hasGlobalPermission('templates', 'update')) {
         die('No permission');
     }
     if (returnGlobal('action') == "templaterename" && returnGlobal('newname') && returnGlobal('copydir')) {
         $clang = Yii::app()->lang;
         $sOldName = sanitize_dirname(returnGlobal('copydir'));
         $sNewName = sanitize_dirname(returnGlobal('newname'));
         $sNewDirectoryPath = Yii::app()->getConfig('usertemplaterootdir') . "/" . $sNewName;
         $sOldDirectoryPath = Yii::app()->getConfig('usertemplaterootdir') . "/" . returnGlobal('copydir');
         if (isStandardTemplate(returnGlobal('newname'))) {
             $this->getController()->error(sprintf($clang->gT("Template could not be renamed to `%s`.", "js"), $sNewName) . " " . $clang->gT("This name is reserved for standard template.", "js"));
         } elseif (file_exists($sNewDirectoryPath)) {
             $this->getController()->error(sprintf($clang->gT("Template could not be renamed to `%s`.", "js"), $sNewName) . " " . $clang->gT("A template with that name already exists.", "js"));
         } elseif (rename($sOldDirectoryPath, $sNewDirectoryPath) == false) {
             $this->getController()->error(sprintf($clang->gT("Template could not be renamed to `%s`.", "js"), $sNewName) . " " . $clang->gT("Maybe you don't have permission.", "js"));
         } else {
             Survey::model()->updateAll(array('template' => $sNewName), "template = :oldname", array(':oldname' => $sOldName));
             if (getGlobalSetting('defaulttemplate') == $sOldName) {
                 setGlobalSetting('defaulttemplate', $sNewName);
             }
             $this->index("startpage.pstpl", "welcome", $sNewName);
         }
     }
 }
开发者ID:Narasimman,项目名称:UrbanExpansion,代码行数:32,代码来源:templates.php


示例4: upgradeTables143


//.........这里部分代码省略.........
            $iSaveSQID = $aQIDReplacements[$row['qid'] . '_' . $row['code']];
        } else {
            $iSaveSQID = $aInsert['qid'];
        }
        if (($row['type'] == 'M' || $row['type'] == 'P') && $row['default_value'] == 'Y') {
            modifyDatabase("", "INSERT INTO {{defaultvalues}} (qid, sqid, scale_id,language,specialtype,defaultvalue) VALUES ({$row['qid']},{$iSaveSQID},0," . dbQuoteAll($row['language']) . ",'','Y')");
            echo $modifyoutput;
            flush();
            @ob_flush();
        }
    }
    // Sanitize data
    if (Yii::app()->db->driverName == 'pgsql') {
        modifyDatabase("", "delete from {{answers}} USING {{questions}} WHERE {{answers}}.qid={{questions}}.qid AND {{questions}}.type in ('1','F','H','M','P','W','Z')");
        echo $modifyoutput;
        flush();
        @ob_flush();
    } else {
        modifyDatabase("", "delete {{answers}} from {{answers}} LEFT join {{questions}} ON {{answers}}.qid={{questions}}.qid where {{questions}}.type in ('1','F','H','M','P','W','Z')");
        echo $modifyoutput;
        flush();
        @ob_flush();
    }
    // Convert labels to answers
    $answerquery = "select qid ,type ,lid ,lid1, language from {{questions}} where parent_qid=0 and type in ('1','F','H','M','P','W','Z')";
    $answerresult = Yii::app()->getDb()->createCommand($answerquery)->queryAll();
    foreach ($answerresult as $row) {
        $labelquery = "Select * from {{labels}} where lid={$row['lid']} and language=" . dbQuoteAll($row['language']);
        $labelresult = Yii::app()->getDb()->createCommand($labelquery)->queryAll();
        foreach ($labelresult as $lrow) {
            modifyDatabase("", "INSERT INTO {{answers}} (qid, code, answer, sortorder, language, assessment_value) VALUES ({$row['qid']}," . dbQuoteAll($lrow['code']) . "," . dbQuoteAll($lrow['title']) . ",{$lrow['sortorder']}," . dbQuoteAll($lrow['language']) . ",{$lrow['assessment_value']})");
            echo $modifyoutput;
            flush();
            @ob_flush();
            //$labelids[]
        }
        if ($row['type'] == '1') {
            $labelquery = "Select * from {{labels}} where lid={$row['lid1']} and language=" . dbQuoteAll($row['language']);
            $labelresult = Yii::app()->getDb()->createCommand($labelquery)->queryAll();
            foreach ($labelresult as $lrow) {
                modifyDatabase("", "INSERT INTO {{answers}} (qid, code, answer, sortorder, language, scale_id, assessment_value) VALUES ({$row['qid']}," . dbQuoteAll($lrow['code']) . "," . dbQuoteAll($lrow['title']) . ",{$lrow['sortorder']}," . dbQuoteAll($lrow['language']) . ",1,{$lrow['assessment_value']})");
                echo $modifyoutput;
                flush();
                @ob_flush();
            }
        }
    }
    // Convert labels to subquestions
    $answerquery = "select * from {{questions}} where parent_qid=0 and type in (';',':')";
    $answerresult = Yii::app()->getDb()->createCommand($answerquery)->queryAll();
    foreach ($answerresult as $row) {
        $labelquery = "Select * from {{labels}} where lid={$row['lid']} and language=" . dbQuoteAll($row['language']);
        $labelresult = Yii::app()->getDb()->createCommand($labelquery)->queryAll();
        foreach ($labelresult as $lrow) {
            $aInsert = array();
            if (isset($aQIDReplacements[$row['qid'] . '_' . $lrow['code'] . '_1'])) {
                $aInsert['qid'] = $aQIDReplacements[$row['qid'] . '_' . $lrow['code'] . '_1'];
            }
            $aInsert['sid'] = $row['sid'];
            $aInsert['gid'] = $row['gid'];
            $aInsert['parent_qid'] = $row['qid'];
            $aInsert['type'] = $row['type'];
            $aInsert['title'] = $lrow['code'];
            $aInsert['question'] = $lrow['title'];
            $aInsert['question_order'] = $lrow['sortorder'];
            $aInsert['language'] = $lrow['language'];
            $aInsert['scale_id'] = 1;
            $iLastInsertID = Question::model()->insertRecords($aInsert);
            if (isset($aInsert['qid'])) {
                $aQIDReplacements[$row['qid'] . '_' . $lrow['code'] . '_1'] = $iLastInsertID;
            }
        }
    }
    $updatequery = "update {{questions}} set type='!' where type='W'";
    modifyDatabase("", $updatequery);
    echo $modifyoutput;
    flush();
    @ob_flush();
    $updatequery = "update {{questions}} set type='L' where type='Z'";
    modifyDatabase("", $updatequery);
    echo $modifyoutput;
    flush();
    @ob_flush();
    // Now move all non-standard templates to the /upload dir
    $usertemplaterootdir = Yii::app()->getConfig("usertemplaterootdir");
    $standardtemplaterootdir = Yii::app()->getConfig('standardtemplaterootdir');
    if (!$usertemplaterootdir) {
        die("getTemplateList() no template directory");
    }
    if ($handle = opendir($standardtemplaterootdir)) {
        while (false !== ($file = readdir($handle))) {
            if (!is_file("{$standardtemplaterootdir}/{$file}") && $file != "." && $file != ".." && $file != ".svn" && !isStandardTemplate($file)) {
                if (!rename($standardtemplaterootdir . DIRECTORY_SEPARATOR . $file, $usertemplaterootdir . DIRECTORY_SEPARATOR . $file)) {
                    echo "There was a problem moving directory '" . $standardtemplaterootdir . DIRECTORY_SEPARATOR . $file . "' to '" . $usertemplaterootdir . DIRECTORY_SEPARATOR . $file . "' due to missing permissions. Please do this manually.<br />";
                }
            }
        }
        closedir($handle);
    }
}
开发者ID:CSCI-462-01-2016,项目名称:LimeSurvey,代码行数:101,代码来源:updatedb_helper.php


示例5: upgrade_tables143


//.........这里部分代码省略.........
                flush();
                ob_flush();
            }
        }
    }
    modify_database("", "delete {$dbprefix}answers from {$dbprefix}answers LEFT join {$dbprefix}questions ON {$dbprefix}answers.qid={$dbprefix}questions.qid where {$dbprefix}questions.type in ('1','F','H','M','P','W','Z')");
    echo $modifyoutput;
    flush();
    ob_flush();
    // Convert labels to answers
    $answerquery = "select qid ,type ,lid ,lid1, language from {$dbprefix}questions where parent_qid=0 and type in ('1','F','H','M','P','W','Z')";
    $answerresult = db_execute_assoc($answerquery);
    if (!$answerresult) {
        return "Database Error";
    } else {
        while ($row = $answerresult->FetchRow()) {
            $labelquery = "Select * from {$dbprefix}labels where lid={$row['lid']} and language=" . db_quoteall($row['language']);
            $labelresult = db_execute_assoc($labelquery);
            while ($lrow = $labelresult->FetchRow()) {
                modify_database("", "INSERT INTO {$dbprefix}answers (qid, code, answer, sortorder, language, assessment_value) VALUES ({$row['qid']}," . db_quoteall($lrow['code']) . "," . db_quoteall($lrow['title']) . ",{$lrow['sortorder']}," . db_quoteall($lrow['language']) . ",{$lrow['assessment_value']})");
                echo $modifyoutput;
                flush();
                ob_flush();
                //$labelids[]
            }
            if ($row['type'] == '1') {
                $labelquery = "Select * from {$dbprefix}labels where lid={$row['lid1']} and language=" . db_quoteall($row['language']);
                $labelresult = db_execute_assoc($labelquery);
                while ($lrow = $labelresult->FetchRow()) {
                    modify_database("", "INSERT INTO {$dbprefix}answers (qid, code, answer, sortorder, language, scale_id, assessment_value) VALUES ({$row['qid']}," . db_quoteall($lrow['code']) . "," . db_quoteall($lrow['title']) . ",{$lrow['sortorder']}," . db_quoteall($lrow['language']) . ",1,{$lrow['assessment_value']})");
                    echo $modifyoutput;
                    flush();
                    ob_flush();
                }
            }
        }
    }
    // Convert labels to subquestions
    $answerquery = "select * from {$dbprefix}questions where parent_qid=0 and type in (';',':')";
    $answerresult = db_execute_assoc($answerquery);
    if (!$answerresult) {
        return "Database Error";
    } else {
        while ($row = $answerresult->FetchRow()) {
            $labelquery = "Select * from {$dbprefix}labels where lid={$row['lid']} and language=" . db_quoteall($row['language']);
            $labelresult = db_execute_assoc($labelquery);
            while ($lrow = $labelresult->FetchRow()) {
                $insertarray = array();
                if (isset($aQIDReplacements[$row['qid'] . '_' . $lrow['code'] . '_1'])) {
                    $insertarray['qid'] = $aQIDReplacements[$row['qid'] . '_' . $lrow['code'] . '_1'];
                    db_switchIDInsert('questions', true);
                }
                $insertarray['sid'] = $row['sid'];
                $insertarray['gid'] = $row['gid'];
                $insertarray['type'] = $row['type'];
                $insertarray['parent_qid'] = $row['qid'];
                $insertarray['title'] = $lrow['code'];
                $insertarray['question'] = $lrow['title'];
                $insertarray['question_order'] = $lrow['sortorder'];
                $insertarray['language'] = $lrow['language'];
                $insertarray['scale_id'] = 1;
                $tablename = "{$dbprefix}questions";
                $query = $connect->GetInsertSQL($tablename, $insertarray);
                modify_database("", $query);
                echo $modifyoutput;
                flush();
                ob_flush();
                if (isset($insertarray['qid'])) {
                    $aQIDReplacements[$row['qid'] . '_' . $lrow['code'] . '_1'] = $connect->Insert_ID("{$dbprefix}questions", "qid");
                    db_switchIDInsert('questions', false);
                }
            }
        }
    }
    $updatequery = "update {$dbprefix}questions set type='!' where type='W'";
    modify_database("", $updatequery);
    echo $modifyoutput;
    flush();
    ob_flush();
    $updatequery = "update {$dbprefix}questions set type='L' where type='Z'";
    modify_database("", $updatequery);
    echo $modifyoutput;
    flush();
    ob_flush();
    // Now move all non-standard templates to the /upload dir
    global $usertemplaterootdir, $standardtemplates, $standardtemplaterootdir;
    if (!$usertemplaterootdir) {
        die("gettemplatelist() no template directory");
    }
    if ($handle = opendir($standardtemplaterootdir)) {
        while (false !== ($file = readdir($handle))) {
            if (!is_file("{$standardtemplaterootdir}/{$file}") && $file != "." && $file != ".." && $file != ".svn" && !isStandardTemplate($file)) {
                if (!rename($standardtemplaterootdir . DIRECTORY_SEPARATOR . $file, $usertemplaterootdir . DIRECTORY_SEPARATOR . $file)) {
                    echo "There was a problem moving directory '" . $standardtemplaterootdir . DIRECTORY_SEPARATOR . $file . "' to '" . $usertemplaterootdir . DIRECTORY_SEPARATOR . $file . "' due to missing permissions. Please do this manually.<br />";
                }
            }
        }
        closedir($handle);
    }
}
开发者ID:portokallidis,项目名称:Metamorphosis-Meducator,代码行数:101,代码来源:upgrade-mssql.php


示例6: getTemplateURL

/**
* This function returns the complete URL path to a given template name
*
* @param mixed $sTemplateName
*/
function getTemplateURL($sTemplateName)
{
    if (isStandardTemplate($sTemplateName)) {
        return Yii::app()->getConfig("standardtemplaterooturl") . '/' . $sTemplateName;
    } else {
        if (file_exists(Yii::app()->getConfig("usertemplaterootdir") . '/' . $sTemplateName)) {
            return Yii::app()->getConfig("usertemplaterooturl") . '/' . $sTemplateName;
        } elseif (file_exists(Yii::app()->getConfig("usertemplaterootdir") . '/' . Yii::app()->getConfig('defaulttemplate'))) {
            return Yii::app()->getConfig("usertemplaterooturl") . '/' . Yii::app()->getConfig('defaulttemplate');
        } elseif (file_exists(Yii::app()->getConfig("standardtemplaterootdir") . '/' . Yii::app()->getConfig('defaulttemplate'))) {
            return Yii::app()->getConfig("standardtemplaterooturl") . '/' . Yii::app()->getConfig('defaulttemplate');
        } else {
            return Yii::app()->getConfig("standardtemplaterooturl") . '/default';
        }
    }
}
开发者ID:rawaludin,项目名称:LimeSurvey,代码行数:21,代码来源:common_helper.php


示例7: templaterename

 /**
  * Function responsible to rename a template(folder).
  *
  * @access public
  * @return void
  */
 public function templaterename()
 {
     if (returnGlobal('action') == "templaterename" && returnGlobal('newname') && returnGlobal('copydir')) {
         $clang = Yii::app()->lang;
         $newname = sanitize_paranoid_string(returnGlobal('newname'));
         $newdirname = Yii::app()->getConfig('usertemplaterootdir') . "/" . $newname;
         $olddirname = Yii::app()->getConfig('usertemplaterootdir') . "/" . returnGlobal('copydir');
         if (isStandardTemplate(returnGlobal('newname'))) {
             $this->getController()->error(sprintf($clang->gT("Template could not be renamed to `%s`.", "js"), $newname) . " " . $clang->gT("This name is reserved for standard template.", "js"));
         } elseif (rename($olddirname, $newdirname) == false) {
             $this->getController()->error(sprintf($clang->gT("Directory could not be renamed to `%s`.", "js"), $newname) . " " . $clang->gT("Maybe you don't have permission.", "js"));
         } else {
             $templatename = $newname;
             $this->index("startpage.pstpl", "welcome", $templatename);
         }
     }
 }
开发者ID:rawaludin,项目名称:LimeSurvey,代码行数:23,代码来源:templates.php


示例8: is_template_editable

/**
* This function checks if a certain template may be by modified, copied, deleted according to the settings in config.php
* @param mixed $templatename
*/
function is_template_editable($templatename)
{
    if (isStandardTemplate($templatename) && Yii::app()->getConfig("standard_templates_readonly") == true) {
        return false;
    } else {
        return true;
    }
}
开发者ID:rawaludin,项目名称:LimeSurvey,代码行数:12,代码来源:template_helper.php


示例9: sGetTemplateURL

/**
* This function returns the complete URL path to a given template name
*
* @param mixed $sTemplateName
*/
function sGetTemplateURL($sTemplateName)
{
    global $standardtemplaterooturl, $standardtemplaterootdir, $usertemplaterooturl, $usertemplaterootdir, $defaulttemplate;
    if (isStandardTemplate($sTemplateName)) {
        return $standardtemplaterooturl . '/' . $sTemplateName;
    } else {
        if (file_exists($usertemplaterootdir . '/' . $sTemplateName)) {
            return $usertemplaterooturl . '/' . $sTemplateName;
        } elseif (file_exists($usertemplaterootdir . '/' . $defaulttemplate)) {
            return $usertemplaterooturl . '/' . $defaulttemplate;
        } elseif (file_exists($standardtemplaterootdir . '/' . $defaulttemplate)) {
            return $standardtemplaterooturl . '/' . $defaulttemplate;
        } else {
            return $standardtemplaterooturl . '/default';
        }
    }
}
开发者ID:karime7gezly,项目名称:OpenConextApps-LimeSurvey,代码行数:22,代码来源:common_functions.php


示例10: is_template_editable

/**
* This function checks if a certain template may be by modified, copied, deleted according to the settings in config.php
* @param mixed $templatename
*/
function is_template_editable($templatename)
{
    global $standard_templates_readonly, $debug, $defaulttemplate;
    if ($debug > 1) {
        return true;
    } elseif (isStandardTemplate($templatename) && $standard_templates_readonly == true) {
        return false;
    } else {
        return true;
    }
}
开发者ID:himanshu12k,项目名称:ce-www,代码行数:15,代码来源:templates.php


示例11: templaterename

 /**
  * Function responsible to rename a template(folder).
  *
  * @access public
  * @return void
  */
 public function templaterename()
 {
     if (returnGlobal('action') == "templaterename" && returnGlobal('newname') && returnGlobal('copydir')) {
         $clang = Yii::app()->lang;
         $oldname = sanitize_paranoid_string(returnGlobal('copydir'));
         $newname = sanitize_paranoid_string(returnGlobal('newname'));
         $newdirname = Yii::app()->getConfig('usertemplaterootdir') . "/" . $newname;
         $olddirname = Yii::app()->getConfig('usertemplaterootdir') . "/" . returnGlobal('copydir');
         if (isStandardTemplate(returnGlobal('newname'))) {
             $this->getController()->error(sprintf($clang->gT("Template could not be renamed to `%s`.", "js"), $newname) . " " . $clang->gT("This name is reserved for standard template.", "js"));
         } elseif (file_exists($newdirname)) {
             $this->getController()->error(sprintf($clang->gT("Template could not be renamed to `%s`.", "js"), $newname) . " " . $clang->gT("A template with that name already exists.", "js"));
         } elseif (rename($olddirname, $newdirname) == false) {
             $this->getController()->error(sprintf($clang->gT("Template could not be renamed to `%s`.", "js"), $newname) . " " . $clang->gT("Maybe you don't have permission.", "js"));
         } else {
             Survey::model()->updateAll(array('template' => $newname), "template = '{$oldname}'");
             $this->index("startpage.pstpl", "welcome", $newname);
         }
     }
 }
开发者ID:jdbaltazar,项目名称:survey-office,代码行数:26,代码来源:templates.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP isSuperAdmin函数代码示例发布时间:2022-05-15
下一篇:
PHP isSelecteDb函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap