本文整理汇总了PHP中TPL::thing方法的典型用法代码示例。如果您正苦于以下问题:PHP TPL::thing方法的具体用法?PHP TPL::thing怎么用?PHP TPL::thing使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TPL
的用法示例。
在下文中一共展示了TPL::thing方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: function
<?php
//TPL::thing("footer", "js", template_url(true)."assets/js/jquery.nestable.js");
TPL::thing("footer", "text", function () {
?>
<script src="<?php
template_url();
?>
assets/js/jquery.nestable.js"></script>
<script type="text/javascript">
$('.dd').nestable({});
$('.dd').on('change', function() {
var v_content = JSON.stringify($('.dd').nestable('serialize') );
$.post('<?php
_link("admin_categories");
?>
', {
new_cat_order:v_content
}, function(data){
if( data.trim() != 'ok' ){
alert("Error: " + data);
}
});
});
</script>
<?php
});
_inc("parts/footer");
示例2: _post
_post("produs_descriere");
?>
</textarea>
</div>
</div>
<hr>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<button type="submit" class="btn btn-primary" name="add_produs_btn"><i class="fa fa-plus"></i> Adauga produs</button>
</div>
</div>
</form>
<?php
TPL::thing('footer', 'text', function () {
?>
<script src="http://cdnjs.cloudflare.com/ajax/libs/summernote/0.8.1/summernote.js"></script>
<script>
$(document).ready(function() {
$('.editor').summernote({
height: 300,
placeholder: "Introduceti continutul paginii"
});
});
</script>
<?php
});
_inc("parts/footer");
示例3: array
if (CONTENT::$current['content_attachment'] == '') {
CONTENT::$current['content_attachment'] = array();
} else {
CONTENT::$current['content_attachment'] = explode(",", CONTENT::$current['content_attachment']);
}
// assign content
TPL::assign("content", CONTENT::get());
// set render
TPL::render("page_produs");
});
if (URL::routed()) {
$c_title = TPL::thing("head", "title");
if ($c_title == '') {
TPL::thing("head", "title", "Adeko");
} else {
TPL::thing("head", "title", $c_title . " | Adeko");
}
}
} else {
EVENTS::add_action("add_page_page_poli_products", function () {
if (isset($_POST['add_produs_btn'])) {
global $db;
// filter
$produs_denumire = trim($db->real_escape($_POST['produs_denumire']));
$produs_caracteristici = trim($_POST['produs_caracteristici']);
$produs_descriere = trim($db->real_escape($_POST['produs_descriere']));
$produs_imagini = $_FILES['produs_imagini'];
// upload imagini
$produs_attash = array();
foreach ($produs_imagini['name'] as $n => $name) {
if (is_uploaded_file($produs_imagini['tmp_name'][$n]) && is_image($produs_imagini['tmp_name'][$n])) {
示例4: function
<?php
TPL::thing('footer', 'text', function () {
?>
<script src="http://cdnjs.cloudflare.com/ajax/libs/summernote/0.8.1/summernote.js"></script>
<script>
$(document).ready(function() {
$('.editor').summernote({
height: 300,
placeholder: "Introduceti continutul paginii"
});
$(".delete-image").click(function(event){
event.preventDefault();
var link = this.href;
swal({
title: "Esti sigur?",
text: "Aceasta imagine va fi stearsa complet.",
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
confirmButtonText: "Da, sterge imaginea!",
closeOnConfirm: false
}, function(){
window.location.href = link;
});
});
});
</script>
<?php
});
_inc("parts/footer");
示例5: show_404
function show_404()
{
// do programmed events
EVENTS::do_action("on_error_404");
// change header status
header("HTTP/1.0 404 Not Found");
// change title if isn't setted
if (TPL::thing("head", "title") == '') {
TPL::thing("head", "title", "Error 404 | Page not found");
}
// set render and draw
if (TPL::check_template("page_404")) {
TPL::render("page_404");
TPL::draw(true);
} else {
echo "<h1>Error 404! Not found</h1>";
}
}
示例6: init
public static function init()
{
TPL::thing("head", "generator", "Drawline");
}
示例7: function
</div>
</div>
<?php
}
?>
</div>
</div>
<br><br>
<?php
TPL::thing("footer", "text", function () {
?>
<script src="<?php
template_url();
?>
assets/js/jquery.nestable.js"></script>
<script type="text/javascript">
$('.dd').nestable({});
$("#items_order").val(JSON.stringify($('.dd').nestable('serialize') ));
$('.dd').on('change', function() {
$("#items_order").val(JSON.stringify($('.dd').nestable('serialize') ));
});
</script>
<?php
});
_inc("parts/footer");
示例8:
<?php
TPL::render("index");
TPL::thing('head', 'title', 'Drawline | Draw your success line');
示例9: function
if (!defined("DRAWLINE_RUN_FROM_INDEX")) {
die;
}
// service ERROR REPORTING
include FOLDER_WEBAPP . "services" . DS . "service_error_reporting.php";
// service MINIFY CONTENT
include FOLDER_WEBAPP . "services" . DS . "service_minify.php";
// service SITEMAP
include FOLDER_WEBAPP . "services" . DS . "service_sitemap.php";
// service THUMBS
include FOLDER_WEBAPP . "services" . DS . "service_thumbs.php";
URL::route("/", function () {
TPL::render("pages/page_home");
});
if (CONTENT::is_page()) {
TPL::thing("head", "title", CONTENT::$current['content_title']);
EVENTS::add_action("view_page_page_text", function () {
TPL::assign("content", CONTENT::get());
TPL::render("pages/page_text");
});
EVENTS::add_action("before_render", function () {
EVENTS::do_action("view_page_" . CONTENT::get("content_type"));
});
URL::routed(true);
}
if (!URL::routed()) {
$request = URL::get_request();
if (substr($request, -1) == '/') {
$request = substr($request, 0, -1);
}
$not_allowed = array("home", "text", "404", "maintenance");
示例10: function
}
?>
<br><br>
<?php
TPL::thing('footer', 'text', function () {
?>
<script type="text/javascript">
$(".btn-uninstall").click(function(event){
event.preventDefault();
var link = this.href;
swal({
title: "Are you sure?",
text: "You could lost some data, uninstalling this plugin.",
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
confirmButtonText: "Yes, uninstall it!",
closeOnConfirm: false
}, function(){
window.location.href = link;
});
});
</script>
<?php
});
_inc("parts/footer");
示例11: function
TPL::thing('footer', 'text', function () {
?>
<?php
$rgba = explode(",", _v("color_scheme_1", true));
array_pop($rgba);
$color_rgb = implode(",", $rgba);
?>
<script type="text/javascript">
$("document").ready(function(){
$(".background-images").click(function(event){
event.preventDefault();
$(".background-images").removeClass("current-image");
$(this).addClass("current-image");
$("body").css("background", "url("+ $(this).attr("base-image") +") no-repeat center center fixed");
$.post('<?php
_link("admin_settings_backend");
?>
', {
new_background:$(this).attr("base-image")
}, function(data){
if( data.trim() != 'ok' ){
alert("Error: " + data);
}
});
});
function save_color_scheme(){
$.post('<?php
_link("admin_settings_backend");
?>
', {
new_color: get_color_scheme()
}, function(data){
if( data.trim() != 'ok' ){
alert("Error: " + data);
}
});
}
function apply_color_scheme(){
$("#sidebar-menu").css( "background", get_color_scheme() );
$("#sidebar-submenu, .navbar-inverse").css( "background", get_color_scheme( true ) );
}
function get_color_scheme( add ){
var color_intesity = $('#intensity').val() / 100;
add = (typeof add === 'undefined') ? false : add;
if( add == true ) color_intesity += 0.1;
var v = String($("#showPalette").spectrum("get"));
var cs = "rgba" + v.slice(3, -1) + ", " + color_intesity +")";
return cs;
}
$("#showPalette").spectrum({
showButtons: false,
preferredFormat: "rgb",
showPalette: true,
color: "rgb(<?php
echo $color_rgb;
?>
)",
palette: [
['rgb(72, 46, 18)', 'black', 'white', 'blanchedalmond'],
['rgb(255, 128, 0);', 'hsv 100 70 50', 'lightyellow']
],
move: function(color) {
apply_color_scheme();
},
change: function(color) {
save_color_scheme();
apply_color_scheme();
}
});
$('#intensity').on("mousemove", function() {
apply_color_scheme();
});
$('#intensity').on("change", function() {
save_color_scheme();
apply_color_scheme();
});
});
//.........这里部分代码省略.........