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


PHP template_simple_register函数代码示例

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


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

示例1: loader_import

        $results[$key]['url'] .= '?highlight=' . $enc;
    }
}
loader_import('saf.GUI.Pager');
$pg = new Pager($cgi->offset, appconf('limit'));
if ($parameters['multiple'] == 'yes') {
    $t = '';
    if (is_array($parameters['ctype'])) {
        foreach ($parameters['ctype'] as $ct) {
            $t .= '&ctype[]=' . urlencode($ct);
        }
    }
    $d = '';
    if (is_array($parameters['domains'])) {
        foreach ($parameters['domains'] as $ds) {
            $d .= '&domains[]=' . $ds;
        }
    }
} else {
    $t = '&ctype=' . urlencode($parameters['ctype']);
    $d = '&domains=' . urlencode($parameters['domains']);
}
$pg->setUrl(site_current() . '?query=%s' . $t . $d . '&show_types=%s&multiple=%s&show_domains=%s', $enc, $parameters['show_types'], $parameters['multiple'], $parameters['show_domains']);
$pg->total = $total;
$pg->setData($results);
$pg->update();
page_id('search');
page_title('SiteSearch - Results For "' . $cgi->query . '"');
template_simple_register('cgi', $cgi);
template_simple_register('pager', $pg);
echo template_simple('stats_search.spt', array('show_types' => $show_types, 'show_domains' => $show_domains, 'types' => $types, 'domains' => $domains, 'multiple' => $multiple, 'syntax' => $res['metadata']['syntax']));
开发者ID:vojtajina,项目名称:sitellite,代码行数:31,代码来源:index.php

示例2: parse_ini_file

	//this box is to be listed
	} else {
		//check for an access file, if there isnt on, dont list 
		$access_file = parse_ini_file($path . '/' . $file . '/boxes/index/access.php');
		
		//if there is an access file make sure it states this box should be listed
		if($access_file['sitellite_inline'])//this box is to be listed
		{	
			//see if a) there is a config.ini.php and b) if there is a preferred name in there
			if(file_exists($path . '/' . $file . '/conf/config.ini.php'))
			{	$config_file = parse_ini_file($path . '/' . $file . '/conf/config.ini.php');
				if($config_file['app_name'])
				{	//add data to the boxes array
					$data['boxes'][] = array($file, $config_file['app_name']);
				}
			//there is no app_name to specify, use folder name
			} else {
				//add data to the boxes array
				$data['boxes'][] = array($file, $file);
			}
		}
	}
}*/
//info($data['boxes']);
//$data['friendly_path'] = substr($data['location'], strlen($root)+1);
//$data['url_prefix'] = $data['url_prefix'] . $data['friendly_path'];
// show me the money
//info($data);
template_simple_register('cgi', $cgi);
echo template_simple('index.spt', $data);
exit;
开发者ID:vojtajina,项目名称:sitellite,代码行数:31,代码来源:index.php

示例3: session_allowed_sql

<?php

if (session_admin()) {
    $acl = session_allowed_sql();
} else {
    $acl = session_approved_sql();
}
$res = db_fetch_array('select name, display_title, extension, description from sitellite_filesystem where path = ? and ' . $acl . ' order by name asc', $parameters['path']);
$valid = appconf('valid');
foreach (array_keys($res) as $k) {
    if (!in_array(strtolower($res[$k]->extension), $valid)) {
        unset($res[$k]);
    }
}
if ($parameters['title']) {
    if ($box['context'] == 'action') {
        page_title($parameters['title']);
    } else {
        echo '<h2>' . $parameters['title'] . '</h2>';
    }
}
page_add_script(site_prefix() . '/js/rollover.js');
template_simple_register('results', $res);
template_simple_register('first', array_shift($res));
echo template_simple('slideshow.spt', array('path' => $parameters['path'], 'total' => count($res) + 1, 'desc' => $parameters['descriptions'], 'delay' => $parameters['delay']));
开发者ID:vojtajina,项目名称:sitellite,代码行数:25,代码来源:index.php

示例4: list

    if (strstr($cgi->lang, '-')) {
        list($code, $locale) = split('-', $cgi->lang);
    } else {
        $code = $cgi->lang;
        $locale = '';
    }
    // rewrite file
    global $intl;
    if (!$intl->writeLanguage($file_lang, $this->lang_hash[$cgi->lang], $code, $locale)) {
        page_title(intl_get('An Error Occurred'));
        echo $intl->error;
        return;
    }
}
if ($parameters['home'] == 'yes') {
    header('Location: ' . site_prefix() . '/index/multilingual-translation-action?appname=' . $cgi->appname);
    exit;
}
$parameters['screen_total'] = ceil(count($index) / $limit);
$parameters['screen_num'] = $cgi->offset / $limit + 1;
$parameters['more'] = $cgi->offset + $limit < count($index) ? true : false;
$show = array_slice($index, $cgi->offset, $limit);
foreach ($show as $k => $v) {
    $show[$k]['current'] = $this->lang_hash[$cgi->lang][stripslashes($k)];
}
header('Content-Type: text/html; charset=' . $cgi->charset);
$langs = ini_parse($file_langs);
page_title(intl_get('Editing Language') . ': ' . $langs[$cgi->lang]['name']);
template_simple_register('show', $show);
echo template_simple('translation_strings.spt', $parameters);
//info ($show, true);
开发者ID:vojtajina,项目名称:sitellite,代码行数:31,代码来源:index.php

示例5: loader_import

<?php

loader_import('sitegallery.Functions');
if (session_admin()) {
    $acl = session_allowed_sql();
} else {
    $acl = session_approved_sql();
}
$res = db_fetch_array('select name, display_title, extension, description from sitellite_filesystem where path = ? and ' . $acl . ' order by name asc', $parameters['path']);
if ($parameters['title']) {
    if ($box['context'] == 'action') {
        page_title($parameters['title']);
    } else {
        echo '<h2>' . $parameters['title'] . '</h2>';
    }
}
$valid = appconf('valid');
foreach (array_keys($res) as $k) {
    if (!in_array(strtolower($res[$k]->extension), $valid)) {
        unset($res[$k]);
        continue;
    }
    $res[$k]->src = sitegallery_get_thumbnail($parameters['path'] . '/' . $res[$k]->name . '.' . $res[$k]->extension, true);
    //list ($res[$k]->width, $res[$k]->height) = getimagesize ('inc/data/' . $parameters['path'] . '/' . $res[$k]->name . '.' . $res[$k]->extension);
}
template_simple_register('results', $res);
page_add_script(site_prefix() . '/inc/app/sitegallery/js/prototype.js');
page_add_script(site_prefix() . '/inc/app/sitegallery/js/scriptaculous.js?load=effects');
page_add_script(site_prefix() . '/inc/app/sitegallery/js/lightbox.js');
page_add_style(site_prefix() . '/inc/app/sitegallery/html/lightbox.css');
echo template_simple('gallery.spt', array('path' => $parameters['path'], 'total' => count($res) + 1, 'desc' => $parameters['descriptions']));
开发者ID:vojtajina,项目名称:sitellite,代码行数:31,代码来源:index.php

示例6: loader_import

    $multiple = false;
}
global $cgi;
if (isset($cgi->ctype)) {
    $parameters['ctype'] = $cgi->ctype;
}
loader_import('sitesearch.Logger');
$logger = new SiteSearchLogger();
if ($parameters['show_types'] == 'yes') {
    $show_types = true;
    $data = $logger->getCurrentIndex();
    if (!$data) {
        $types = array();
    } else {
        $counts = unserialize($data->counts);
        if (!is_array($counts)) {
            $types = array();
        } else {
            loader_import('sitesearch.Filters');
            $types = array();
            foreach ($counts as $k => $c) {
                $types[$k] = sitesearch_filter_ctype($k);
            }
            asort($types);
        }
    }
} else {
    $show_types = false;
}
template_simple_register('parameters', $parameters);
echo template_simple('sidebar.spt', array('show_types' => $show_types, 'types' => $types, 'multiple' => $multiple));
开发者ID:vojtajina,项目名称:sitellite,代码行数:31,代码来源:index.php

示例7: switch

        $perms = $vals['requires'];
        switch ($perms) {
            case 'r':
            case 'w':
            case 'rw':
                if (session_is_resource($cgi->collection) && !session_allowed($cgi->collection, $perms, 'resource')) {
                    continue;
                }
                break;
        }
        if (isset($vals['requires resource'])) {
            if (session_is_resource($vals['requires resource']) && !session_allowed($vals['requires resource'], 'rw', 'resource')) {
                continue;
            }
        }
        $vals['text'] = intl_get($vals['text']);
        if (strpos($vals['url'], '/index/') === 0) {
            $vals['url'] = site_prefix() . $vals['url'];
        }
        $data['links'][] = $vals;
    }
}
echo template_simple(CMS_JS_ALERT_MESSAGE, $GLOBALS['cgi']);
echo loader_box('cms/nav');
template_simple_register('pager', $pg);
template_simple_register('locks', $locks);
template_simple_register('editable', $editable);
template_simple_register('align', $align);
template_simple_register('width', $width);
echo template_simple('browse.spt', $data);
//info ($pg);
开发者ID:vojtajina,项目名称:sitellite,代码行数:31,代码来源:index.php

示例8: draw

 function draw()
 {
     global $cgi;
     if (!isset($cgi->orderBy)) {
         $cgi->orderBy = array_shift(array_keys($this->fields));
     }
     if (!isset($cgi->sort)) {
         $cgi->sort = 'asc';
     }
     if (!isset($cgi->offset)) {
         $cgi->offset = 0;
     }
     $list = $this->getList();
     if (!$list) {
         return false;
     }
     if (!$this->primary_key) {
         $this->primary_key = array_shift(array_keys($this->fields));
     }
     $this->list = array();
     foreach ($list as $row) {
         if (!is_object($row)) {
             $row = (object) $row;
         }
         $this->list[$row->{$this->primary_key}] = $row;
     }
     $pg = new Pager($cgi->offset, $this->limit, $this->total);
     $pg->setUrl(site_current() . '?orderBy=%s&sort=%s' . $this->rememberParams(), $cgi->orderBy, $cgi->sort);
     $pg->getInfo();
     $headers = array();
     foreach ($this->fields as $name => $display) {
         $headers[$name] = new TableHeader($name, $display);
     }
     $this->headers =& $headers;
     $this->first_field = array_shift(array_keys($this->fields));
     template_simple_register('pager', $pg);
     return template_simple($this->template, $this);
 }
开发者ID:vojtajina,项目名称:sitellite,代码行数:38,代码来源:DataGrid.php

示例9: header

<?php

// BEGIN KEEPOUT CHECKING
// Add these lines to the very top of any file you don't want people to
// be able to access directly.
if (!defined('SAF_VERSION')) {
    header('HTTP/1.1 404 Not Found');
    echo "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\n" . "<html><head>\n<title>404 Not Found</title>\n</head><body>\n<h1>Not Found</h1>\n" . "The requested URL " . $PHP_SELF . " was not found on this server.<p>\n<hr>\n" . $_SERVER['SERVER_SIGNATURE'] . "</body></html>";
    exit;
}
// END KEEPOUT CHECKING
loader_box('sitellite/nav/init');
// import the global $menu and $page objects
global $menu, $page;
template_simple_register('page', $page);
// the template to display a single menu link.
$template = "<a href=\"{site/prefix}/index/{id}\"{if obj.id eq page.id} class=\"current\"{end if}{if obj.id ne page.id and sitellite_nav_list_in_trail (obj.id)} class=\"parent\"{end if}>{title}</a>\n";
// retrieve the breadcrumb trail to the currently active page.
if ($page->below_page) {
    if (!is_object($menu->{'items_' . $page->id})) {
        $menu->addItem($page->id, $page->title, $page->below_page);
    }
    $trail_as_objects = $menu->{'items_' . $page->id}->trail();
    $trail = array();
    foreach ($trail_as_objects as $obj) {
        $trail[] = $obj->id;
    }
} else {
    $trail = array($page->id);
}
// here we define a few helper functions that will render the menu for us.
开发者ID:vojtajina,项目名称:sitellite,代码行数:31,代码来源:index.php

示例10: die

        if (!Docs::isClass($parameters['class'], $data['classes'])) {
            die('Invalid class!');
        }
        $data['class'] = $parameters['class'];
        if ($parameters['class'] == '_functions_') {
            $functions = docs_cache('func_data', $parameters['package']);
            if (!is_array($functions)) {
                $functions = docs_cache_store(Docs::getFunctions($parameters['package']), 'func_data', $parameters['package']);
            }
            template_simple_register('functions', $functions);
        } else {
            $class = docs_cache('class_data', $parameters['package'], $parameters['class']);
            if (!is_array($class)) {
                $class = docs_cache_store(Docs::getClass($parameters['package'], $parameters['class']), 'class_data', $parameters['package'], $parameters['class']);
            }
            template_simple_register('class', $class);
        }
    }
} else {
    $data['package'] = false;
    $data['class'] = false;
}
$data['apps'] = Docs::apps();
$data['current'] = $parameters['current'];
$data['current_name'] = $data['apps'][$data['current']];
if (empty($data['current_name'])) {
    $data['current_name'] = appconf('title');
}
page_add_style(site_prefix() . '/inc/app/docs/html/docs.css');
page_add_script(site_prefix() . '/js/jquery-1.2.3.min.js');
page_add_script(site_prefix() . '/js/jquery.cookie.js');
开发者ID:vojtajina,项目名称:sitellite,代码行数:31,代码来源:index.php


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