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

PHP theme_include函数代码示例

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

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



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

示例1: pdledit_content

function pdledit_content(&$a)
{
    if (!local_channel()) {
        notice(t('Permission denied.') . EOL);
        return;
    }
    if (argc() > 1) {
        $module = 'mod_' . argv(1) . '.pdl';
    } else {
        $o .= '<h1>' . t('Edit System Page Description') . '</h1>';
        $files = glob('mod/*');
        if ($files) {
            foreach ($files as $f) {
                $name = basename($f, '.php');
                $x = theme_include('mod_' . $name . '.pdl');
                if ($x) {
                    $o .= '<a href="pdledit/' . $name . '" >' . $name . '</a><br />';
                }
            }
        }
        // list module pdl files
        return $o;
    }
    $t = get_pconfig(local_channel(), 'system', $module);
    if (!$t) {
        $t = file_get_contents(theme_include($module));
    }
    if (!$t) {
        notice(t('Layout not found.') . EOL);
        return '';
    }
    $o = replace_macros(get_markup_template('pdledit.tpl'), array('$header' => t('Edit System Page Description'), '$mname' => t('Module Name:'), '$help' => t('Layout Help'), '$module' => argv(1), '$content' => htmlspecialchars($t, ENT_COMPAT, 'UTF-8'), '$submit' => t('Submit')));
    return $o;
}
开发者ID:bashrc,项目名称:hubzilla,代码行数:34,代码来源:pdledit.php


示例2: get_intltext_template

 public function get_intltext_template($file, $root = '')
 {
     $lang = \App::$language;
     if (file_exists("view/{$lang}/{$file}")) {
         $template_file = "view/{$lang}/{$file}";
     } elseif (file_exists("view/en/{$file}")) {
         $template_file = "view/en/{$file}";
     } else {
         $template_file = theme_include($file, $root);
     }
     if ($template_file) {
         $template = new SmartyInterface();
         $template->filename = $template_file;
         return $template;
     }
     return "";
 }
开发者ID:phellmes,项目名称:hubzilla,代码行数:17,代码来源:SmartyTemplate.php


示例3: get

 function get()
 {
     if (!local_channel()) {
         notice(t('Permission denied.') . EOL);
         return;
     }
     if (!feature_enabled(local_channel(), 'advanced_theming')) {
         notice(t('Feature disabled.') . EOL);
         return;
     }
     if (argc() > 1) {
         $module = 'mod_' . argv(1) . '.pdl';
     } else {
         $o .= '<div class="generic-content-wrapper-styled">';
         $o .= '<h1>' . t('Edit System Page Description') . '</h1>';
         $files = glob('Zotlabs/Module/*.php');
         if ($files) {
             foreach ($files as $f) {
                 $name = lcfirst(basename($f, '.php'));
                 $x = theme_include('mod_' . $name . '.pdl');
                 if ($x) {
                     $o .= '<a href="pdledit/' . $name . '" >' . $name . '</a><br />';
                 }
             }
         }
         $o .= '</div>';
         // list module pdl files
         return $o;
     }
     $t = get_pconfig(local_channel(), 'system', $module);
     if (!$t) {
         $t = file_get_contents(theme_include($module));
     }
     if (!$t) {
         notice(t('Layout not found.') . EOL);
         return '';
     }
     $o = replace_macros(get_markup_template('pdledit.tpl'), array('$header' => t('Edit System Page Description'), '$mname' => t('Module Name:'), '$help' => t('Layout Help'), '$module' => argv(1), '$content' => htmlspecialchars($t, ENT_COMPAT, 'UTF-8'), '$submit' => t('Submit')));
     return $o;
 }
开发者ID:phellmes,项目名称:hubzilla,代码行数:40,代码来源:Pdledit.php


示例4: format_js_if_exists

function format_js_if_exists($source)
{
    $path_prefix = script_path() . '/';
    if (strpos($source, '/') !== false) {
        // The source is a URL
        $path = $source;
        // If the url starts with // then it's an absolute URL
        if ($source[0] === '/' && $source[1] === '/') {
            $path_prefix = '';
        }
    } else {
        // It's a file from the theme
        $path = theme_include($source);
    }
    if ($path) {
        $qstring = (parse_url($path, PHP_URL_QUERY) ? '&' : '?') . 'v=' . STD_VERSION;
        return '<script src="' . $path_prefix . $path . $qstring . '" ></script>' . "\r\n";
    }
}
开发者ID:phellmes,项目名称:hubzilla,代码行数:19,代码来源:plugin.php


示例5: widget

 /**
  * Widgets will have to get any operational arguments from the session, the
  * global app environment, or config storage until we implement argument passing
  *
  * @param string $name
  * @param string $text
  */
 function widget($name, $text)
 {
     $vars = array();
     $matches = array();
     $cnt = preg_match_all("/\\[var=(.*?)\\](.*?)\\[\\/var\\]/ism", $text, $matches, PREG_SET_ORDER);
     if ($cnt) {
         foreach ($matches as $mtch) {
             $vars[$mtch[1]] = $mtch[2];
         }
     }
     $func = 'widget_' . trim($name);
     if (!function_exists($func)) {
         if (file_exists('widget/' . trim($name) . '.php')) {
             require_once 'widget/' . trim($name) . '.php';
         } elseif (file_exists('widget/' . trim($name) . '/' . trim($name) . '.php')) {
             require_once 'widget/' . trim($name) . '/' . trim($name) . '.php';
         }
     } else {
         $theme_widget = $func . '.php';
         if (!function_exists($func) && theme_include($theme_widget)) {
             require_once theme_include($theme_widget);
         }
     }
     if (function_exists($func)) {
         return $func($vars);
     }
 }
开发者ID:anmol26s,项目名称:hubzilla-yunohost,代码行数:34,代码来源:Comanche.php


示例6: construct_page

/**
 * @brief build the page.
 *
 * Build the page - now that we have all the components
 *
 * @param App &$a global application object
 */
function construct_page(&$a)
{
    exec_pdl($a);
    $comanche = count(App::$layout) ? true : false;
    require_once theme_include('theme_init.php');
    $installing = false;
    if (App::$module == 'setup') {
        $installing = true;
    } else {
        nav($a);
    }
    if ($comanche) {
        if (App::$layout['nav']) {
            App::$page['nav'] = get_custom_nav($a, App::$layout['nav']);
        }
    }
    $current_theme = Zotlabs\Render\Theme::current();
    if (($p = theme_include($current_theme[0] . '.js')) != '') {
        head_add_js($p);
    }
    if (($p = theme_include('mod_' . App::$module . '.php')) != '') {
        require_once $p;
    }
    require_once 'include/js_strings.php';
    if (x(App::$page, 'template_style')) {
        head_add_css(App::$page['template_style'] . '.css');
    } else {
        head_add_css((x(App::$page, 'template') ? App::$page['template'] : 'default') . '.css');
    }
    head_add_css('mod_' . App::$module . '.css');
    head_add_css(Zotlabs\Render\Theme::url($installing));
    head_add_js('mod_' . App::$module . '.js');
    App::build_pagehead();
    if (App::$page['pdl_content']) {
        App::$page['content'] = App::$comanche->region(App::$page['content']);
    }
    // Let's say we have a comanche declaration '[region=nav][/region][region=content]$nav $content[/region]'.
    // The text 'region=' identifies a section of the layout by that name. So what we want to do here is leave
    // App::$page['nav'] empty and put the default content from App::$page['nav'] and App::$page['section']
    // into a new region called App::$data['content']. It is presumed that the chosen layout file for this comanche page
    // has a '<content>' element instead of a '<section>'.
    // This way the Comanche layout can include any existing content, alter the layout by adding stuff around it or changing the
    // layout completely with a new layout definition, or replace/remove existing content.
    if ($comanche) {
        $arr = array('module' => App::$module, 'layout' => App::$layout);
        call_hooks('construct_page', $arr);
        App::$layout = $arr['layout'];
        foreach (App::$layout as $k => $v) {
            if (strpos($k, 'region_') === 0 && strlen($v)) {
                if (strpos($v, '$region_') !== false) {
                    $v = preg_replace_callback('/\\$region_([a-zA-Z0-9]+)/ism', array(App::$comanche, 'replace_region'), $v);
                }
                // And a couple of convenience macros
                if (strpos($v, '$htmlhead') !== false) {
                    $v = str_replace('$htmlhead', App::$page['htmlhead'], $v);
                }
                if (strpos($v, '$nav') !== false) {
                    $v = str_replace('$nav', App::$page['nav'], $v);
                }
                if (strpos($v, '$content') !== false) {
                    $v = str_replace('$content', App::$page['content'], $v);
                }
                App::$page[substr($k, 7)] = $v;
            }
        }
    }
    if (App::$is_mobile || App::$is_tablet) {
        if (isset($_SESSION['show_mobile']) && !$_SESSION['show_mobile']) {
            $link = z_root() . '/toggle_mobile?f=&address=' . curPageURL();
        } else {
            $link = z_root() . '/toggle_mobile?f=&off=1&address=' . curPageURL();
        }
        if (isset($_SESSION) && $_SESSION['mobile_theme'] != '' && $_SESSION['mobile_theme'] != '---' || isset(App::$config['system']['mobile_theme']) && !isset($_SESSION['mobile_theme'])) {
            App::$page['footer'] .= replace_macros(get_markup_template("toggle_mobile_footer.tpl"), array('$toggle_link' => $link, '$toggle_text' => t('toggle mobile')));
        }
    }
    $page = App::$page;
    $profile = App::$profile;
    // There's some experimental support for right-to-left text in the view/php/default.php page template.
    // In v1.9 we started providing direction preference in the per language hstrings.php file
    // This requires somebody with fluency in a RTL language to make happen
    $page['direction'] = 0;
    // ((App::$rtl) ? 1 : 0);
    header("Content-type: text/html; charset=utf-8");
    // security headers - see https://securityheaders.io
    if (App::get_scheme() === 'https' && App::$config['system']['transport_security_header']) {
        header("Strict-Transport-Security: max-age=31536000");
    }
    if (App::$config['system']['content_security_policy']) {
        header("Content-Security-Policy: script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'");
    }
    if (App::$config['system']['x_security_headers']) {
        header("X-Frame-Options: SAMEORIGIN");
//.........这里部分代码省略.........
开发者ID:einervonvielen,项目名称:hubzilla,代码行数:101,代码来源:boot.php


示例7: theme_include

<?php

theme_include("header");
?>

<h2><?php 
echo page_title();
?>
</h2>
<?php 
echo page_content();
?>

<?php 
theme_include("footer");
开发者ID:95jonpet,项目名称:anchor-blue,代码行数:15,代码来源:page.php


示例8: while

		<ul>
		<?php 
while (categories()) {
    ?>
		<?php 
    if (category_id() == 2) {
        continue;
    }
    ?>
			<li><a href="<?php 
    echo category_url();
    ?>
"><?php 
    echo category_title();
    ?>
</a> - <?php 
    echo category_description();
    ?>
</li>
		<?php 
}
?>
	
		</ul>

	</article>
</main>

<?php 
theme_include('partial/footer');
开发者ID:svita-cz,项目名称:web,代码行数:30,代码来源:page-sbirky.php


示例9: article_css

        <?php 
if (customised()) {
    ?>
            <!-- Custom CSS -->
            <style><?php 
    echo article_css();
    ?>
</style>

            <!--  Custom Javascript -->
            <script><?php 
    echo article_js();
    ?>
</script>
        <?php 
}
?>
    </head>
    <body>
    
    <div class="header">
        <?php 
theme_include("navigation");
?>
    </div>

    <div class="container">
        <div class="row">

            <div class="col-md-8 content">
开发者ID:95jonpet,项目名称:anchor-blue,代码行数:30,代码来源:header.php


示例10: format_js_if_exists

function format_js_if_exists($source)
{
    if (strpos($source, '/') !== false) {
        $path = $source;
    } else {
        $path = theme_include($source);
    }
    if ($path) {
        return '<script src="' . script_path() . '/' . $path . '" ></script>' . "\r\n";
    }
}
开发者ID:msooon,项目名称:hubzilla,代码行数:11,代码来源:plugin.php


示例11: base_url

">
		<div class="main">
			<header class="header">
				<div class="header__wrapper">
					<a class="header__logo" href="<?php 
echo base_url();
?>
">
						<?php 
if (theme_option('header_logo')) {
    ?>
							<img src="<?php 
    echo theme_option('logo_src');
    ?>
">
						<?php 
} else {
    ?>
							<?php 
    echo site_name();
    ?>
						<?php 
}
?>
					</a>
					<?php 
theme_include('partials/navigation');
?>
				</div>
			</header>
开发者ID:CraigChilds94,项目名称:anchor-zap,代码行数:30,代码来源:header.php


示例12: format_js_if_exists

function format_js_if_exists($source)
{
    if (strpos($source, '/') !== false) {
        $path = $source;
    } else {
        $path = theme_include($source);
    }
    if ($path) {
        $path = script_path() . '/' . $path;
        $qstring = (parse_url($path, PHP_URL_QUERY) ? '&' : '?') . 'v=' . STD_VERSION;
        return '<script src="' . $path . $qstring . '" ></script>' . "\r\n";
    }
}
开发者ID:anmol26s,项目名称:hubzilla-yunohost,代码行数:13,代码来源:plugin.php


示例13: theme_include

            </div>

            <div class="col-md-4">
                <div class="sidebar">
                    <?php 
theme_include("sidebar");
?>
                </div>
            </div>
        </div>
    </div>

    <div class="footer container-fluid">
        <div class="container">
            <p class="text-center copyright"><?php 
echo site_meta('copyright');
?>
</p>
            <p class="text-center copyright-theme">
                <a href="https://github.com/95jonpet/anchor-blue">Anchor Blue Theme</a>
                by
                <a href="http://95jonpet.se/">95jonpet</a>
            </p>
        </div>
    </div>

    <script src="<?php 
echo theme_url('/js/bootstrap.min.js');
?>
"></script>
开发者ID:95jonpet,项目名称:anchor-blue,代码行数:30,代码来源:footer.php


示例14: construct_page

/**
 * @brief build the page.
 *
 * Build the page - now that we have all the components
 *
 * @param App &$a global application object
 */
function construct_page(&$a)
{
    exec_pdl($a);
    $comanche = count($a->layout) ? true : false;
    require_once theme_include('theme_init.php');
    $installing = false;
    if ($a->module == 'setup') {
        $installing = true;
    } else {
        nav($a);
    }
    if ($comanche) {
        if ($a->layout['nav']) {
            $a->page['nav'] = get_custom_nav($a, $a->layout['nav']);
        }
    }
    if (($p = theme_include(current_theme() . '.js')) != '') {
        head_add_js($p);
    }
    if (($p = theme_include('mod_' . $a->module . '.php')) != '') {
        require_once $p;
    }
    require_once 'include/js_strings.php';
    if (x($a->page, 'template_style')) {
        head_add_css($a->page['template_style'] . '.css');
    } else {
        head_add_css((x($a->page, 'template') ? $a->page['template'] : 'default') . '.css');
    }
    head_add_css('mod_' . $a->module . '.css');
    head_add_css(current_theme_url($installing));
    head_add_js('mod_' . $a->module . '.js');
    $a->build_pagehead();
    $arr = $a->get_widgets();
    ksort($arr, SORT_NUMERIC);
    if (count($arr)) {
        foreach ($arr as $x) {
            if (!array_key_exists($x['location'], $a->page)) {
                $a->page[$x['location']] = '';
            }
            $a->page[$x['location']] .= $x['html'];
        }
    }
    // Let's say we have a comanche declaration '[region=nav][/region][region=content]$nav $content[/region]'.
    // The text 'region=' identifies a section of the layout by that name. So what we want to do here is leave
    // $a->page['nav'] empty and put the default content from $a->page['nav'] and $a->page['section']
    // into a new region called $a->data['content']. It is presumed that the chosen layout file for this comanche page
    // has a '<content>' element instead of a '<section>'.
    // This way the Comanche layout can include any existing content, alter the layout by adding stuff around it or changing the
    // layout completely with a new layout definition, or replace/remove existing content.
    if ($comanche) {
        $arr = array('module' => $a->module, 'layout' => $a->layout);
        call_hooks('construct_page', $arr);
        $a->layout = $arr['layout'];
        foreach ($a->layout as $k => $v) {
            if (strpos($k, 'region_') === 0 && strlen($v)) {
                if (strpos($v, '$region_') !== false) {
                    $v = preg_replace_callback('/\\$region_([a-zA-Z0-9]+)/ism', 'comanche_replace_region', $v);
                }
                // And a couple of convenience macros
                if (strpos($v, '$htmlhead') !== false) {
                    $v = str_replace('$htmlhead', $a->page['htmlhead'], $v);
                }
                if (strpos($v, '$nav') !== false) {
                    $v = str_replace('$nav', $a->page['nav'], $v);
                }
                if (strpos($v, '$content') !== false) {
                    $v = str_replace('$content', $a->page['content'], $v);
                }
                $a->page[substr($k, 7)] = $v;
            }
        }
    }
    if ($a->is_mobile || $a->is_tablet) {
        if (isset($_SESSION['show_mobile']) && !$_SESSION['show_mobile']) {
            $link = $a->get_baseurl() . '/toggle_mobile?f=&address=' . curPageURL();
        } else {
            $link = $a->get_baseurl() . '/toggle_mobile?f=&off=1&address=' . curPageURL();
        }
        if (isset($_SESSION) && $_SESSION['mobile_theme'] != '' && $_SESSION['mobile_theme'] != '---' || isset($a->config['system']['mobile_theme']) && !isset($_SESSION['mobile_theme'])) {
            $a->page['footer'] .= replace_macros(get_markup_template("toggle_mobile_footer.tpl"), array('$toggle_link' => $link, '$toggle_text' => t('toggle mobile')));
        }
    }
    $page = $a->page;
    $profile = $a->profile;
    header("Content-type: text/html; charset=utf-8");
    require_once theme_include((x($a->page, 'template') ? $a->page['template'] : 'default') . '.php');
}
开发者ID:HaakonME,项目名称:redmatrix,代码行数:94,代码来源:boot.php


示例15: get_markup_template

 public function get_markup_template($file, $root = '')
 {
     $template_file = theme_include($file, $root);
     if ($template_file) {
         $content = file_get_contents($template_file);
     }
     return $content;
 }
开发者ID:BlaBlaNet,项目名称:hubzilla,代码行数:8,代码来源:SimpleTemplate.php


示例16: url

                </ul>
            </div>
            <!-- /.navbar-collapse -->
        <?php 
}
?>

        </div>
        <!-- /.container -->
    </nav>

     <!-- Page Header -->
     <!-- Set your background image for this header on the line below. -->

    <header class="intro-header" style="background-image: url('<?php 
theme_include('random');
?>
')">
         <div class="container">
             <div class="row">
                 <div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
                     <div class="site-heading">
                         <h1><?php 
echo site_name();
?>
</h1>
                         <hr class="small">
                         <span class="subheading">Cel mai blog tare de pe planeta !</span>
                     </div>
                 </div>
             </div>
开发者ID:silviuu,项目名称:blg,代码行数:31,代码来源:header.php


示例17: theme_include

<?php

include "langVars.php";
theme_include('page_utils');
?>
<!doctype html>
<html lang="<?php 
echo $lang;
?>
">
<head>
    <meta charset="UTF-8">
    <title><?php 
echo site_name();
?>
</title>

    <meta name="description" content="<?php 
echo site_description();
?>
">

    <link rel="stylesheet" href="<?php 
echo theme_url('/css/custom_font.css');
?>
">
    <link rel="stylesheet" href="<?php 
echo theme_url('/css/reset.css');
?>
">
    <link rel="stylesheet" href="<?php 
开发者ID:Rictus,项目名称:CMS_Prod,代码行数:31,代码来源:header.php


示例18: while

				<?php 
while (categories()) {
    ?>
					<li>
					<a href="<?php 
    echo category_url();
    ?>
" title="<?php 
    echo category_description();
    ?>
">
						<?php 
    echo category_title();
    ?>
 <span><?php 
    echo category_count();
    ?>
</span>
					</a>
				</li>
			<?php 
}
?>
		</ul>

        </div>
      </div>

<?php 
theme_include('footer');
开发者ID:Justin417,项目名称:SimpleBlogDesign,代码行数:30,代码来源:posts.php


示例19: get_intltext_template

 public function get_intltext_template($file, $root = '')
 {
     $a = get_app();
     if (file_exists("view/{App::{$language}}/{$file}")) {
         $template_file = "view/{App::{$language}}/{$file}";
     } elseif (file_exists("view/en/{$file}")) {
         $template_file = "view/en/{$file}";
     } else {
         $template_file = theme_include($file, $root);
     }
     if ($template_file) {
         $template = new FriendicaSmarty();
         $template->filename = $template_file;
         return $template;
     }
     return "";
 }
开发者ID:anmol26s,项目名称:hubzilla-yunohost,代码行数:17,代码来源:smarty.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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