本文整理汇总了PHP中peTheme函数的典型用法代码示例。如果您正苦于以下问题:PHP peTheme函数的具体用法?PHP peTheme怎么用?PHP peTheme使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了peTheme函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct()
{
$this->name = __("WPML - Conditional", 'Pixelentity Theme/Plugin');
$this->description = __("Show/Hide widgets according to language", 'Pixelentity Theme/Plugin');
$this->fields = array("lang" => array("label" => __("Language", 'Pixelentity Theme/Plugin'), "description" => __("Only show subsequent widgets when language match the above selection.", 'Pixelentity Theme/Plugin'), "type" => "RadioUI", "options" => peTheme()->wpml->options(), "default" => ""));
parent::__construct();
}
开发者ID:JeffreyBue,项目名称:jb,代码行数:7,代码来源:PeThemeWidgetWpml.php
示例2: addTemplateValues
protected function addTemplateValues(&$data)
{
$thumbs = $this->data["thumbs"];
$orig = $this->data["orig"];
$data["[ORIG]"] = $orig;
$buffer =& $data["[THUMBNAILS]"];
$buffer = "";
$image =& peTheme()->image;
$pw = 400;
list($img, $w, $h) = $image->aq_resize($orig, $pw, null, null, false);
$pw = $w;
$ph = $h;
$w = 304;
$h = 228;
$buffer .= sprintf('<div class="pe-theme-editor" data-nonce="%s" data-id="%s" data-scale="%s" data-w="%s" data-h="%s" data-pw="%s" data-ph="%s"><img src="%s"/><div class="pe-controls"><input type="button" id="pe-theme-done" class="ob_button" value="%s"/><input type="button" id="pe-theme-cancel" class="ob_button" value="%s"/></div></div>', $this->data["nonce"], $this->data["id"], $this->data["width"] / $pw, $w, $h, $pw, $ph, $img, __("save", 'Pixelentity Theme/Plugin'), __("cancel", 'Pixelentity Theme/Plugin'));
foreach ($thumbs as $t => $size) {
list($tw, $th, $mtime) = $size;
$key = sprintf("%sx%s", $tw, $th);
$buffer .= sprintf('<div class="pe-theme-thumbnail">');
$buffer .= sprintf('<h5>%sx%s</h5>', $tw, $th);
$buffer .= sprintf('<div class="pe-theme-preview" data-size="%sx%s" style="width:%spx;height:%spx"><div style="width:%spx;height:%spx"><img src="%s?t=%s"/></div></div>', $tw, $th, $w, $h, $tw, $th, $t, $mtime);
$value = empty($this->data["value"][$key]) ? "" : $this->data["value"][$key];
$buffer .= sprintf('<input type="hidden" name="%s[%s]" value="%s" data-orig="%s" />', $data['[NAME]'], $key, $value, $value);
$buffer .= sprintf('</div>');
}
if (!isset($this->data["noscript"])) {
$data['[SCRIPT]'] = sprintf('<script type="text/javascript">%s</script>', str_replace("[ID]", $data['[ID]'], $this->jsInit()));
} else {
$data['[SCRIPT]'] = "";
}
}
开发者ID:JeffreyBue,项目名称:jb,代码行数:31,代码来源:PeThemeFormElementThumbnails.php
示例3: widget
public function widget($args, $instance)
{
$instance = $this->clean($instance);
extract($instance);
if (!@$id) {
return;
}
$post = get_post($id);
if (!$post) {
return;
}
echo $args["before_widget"];
if (isset($title)) {
echo "<h3>{$title}</h3>";
}
list($w, $h) = explode("x", $size);
echo "<div>";
$t =& peTheme();
$t->data->postSetup($post);
$t->template->gallery_cover($w, $h);
$t->data->postReset();
$t->template->intro_gallery($id, 90, 74, "fullscreen");
echo "</div>";
echo $args["after_widget"];
}
开发者ID:JeffreyBue,项目名称:jb,代码行数:25,代码来源:PeThemeWidgetGallery.php
示例4: addTemplateValues
protected function addTemplateValues(&$data)
{
parent::addTemplateValues($data);
if (!isset($this->data["noscript"])) {
$data['[SCRIPT]'] = sprintf('<script type="text/javascript">%s</script>', str_replace("[ID]", $data['[ID]'], $this->jsInit()));
} else {
$data['[SCRIPT]'] = "";
}
$data["[VALUE]"] = empty($this->data["value"]) ? $this->data["default"] : $this->data["value"];
$palette = empty($this->data["palette"]) ? array() : array_flip($this->data["palette"]);
$t =& peTheme();
$colors = $t->color->options();
if (!empty($colors)) {
$options = $t->options->all();
$colors = array_keys($colors);
foreach ($colors as $key) {
if ($color = empty($options->{$key}) ? false : $options->{$key}) {
$palette[$color] = $color;
}
}
}
$palette["#000000"] = true;
$palette["#ffffff"] = true;
$palette["#dd3333"] = true;
$palette["#eeee22"] = true;
$palette["#81d742"] = true;
$palette["#1e73be"] = true;
if (!empty($palette)) {
$data["[PALETTE]"] = sprintf('data-palette="%s"', esc_attr(json_encode(array_keys($palette))));
}
}
开发者ID:JeffreyBue,项目名称:jb,代码行数:31,代码来源:PeThemeFormElementColor.php
示例5: container
public function container($atts, $content = null, $code = "")
{
$this->instances++;
$content = $this->parseContent($content);
if (!is_array($this->items) || count($this->items) == 0) {
return "";
}
$count = 1;
$commonID = "accordion" . $this->instances;
$html = "";
if (peTheme()->template->exists("shortcode", "accordion")) {
$items = $this->items;
$conf = (object) compact("atts", "content", "items");
ob_start();
peTheme()->template->get_part($conf, "shortcode", "accordion");
$html = ob_get_clean();
} else {
while ($item = array_shift($this->items)) {
$html .= '<div class="accordion-title"><h5><span></span><a href="#">' . $item->title . '</a></h5></div>
<div class="accordion-inner">
' . $item->body . '
</div>';
}
}
$html = sprintf('<div id="%s" class="accordion" rel="1">%s</div>', $commonID, $html);
return apply_filters("pe_theme_shortcode_accordion", $html, $atts, $content, $commonID);
}
开发者ID:JeffreyBue,项目名称:jb,代码行数:27,代码来源:PeThemeShortcodeVisiaAccordion.php
示例6: __construct
public function __construct()
{
$this->metabox = array("title" => __("Blog", 'Pixelentity Theme/Plugin'), "priority" => "core", "where" => array("page" => "page-blog"), "content" => array("layout" => array("label" => __("Layout", 'Pixelentity Theme/Plugin'), "type" => "RadioUI", "description" => __("Select the required post layout. 'Full' - denotes a full width normal blog layout. 'Compact' - denotes a full width list style layout. 'Mini' - denotes a compressed layout with small post thumbnails.", 'Pixelentity Theme/Plugin'), "options" => PeGlobal::$config["blog"], "default" => ""), "count" => array("label" => __("Max Posts", 'Pixelentity Theme/Plugin'), "type" => "Text", "description" => __("Maximum number of posts to show.", 'Pixelentity Theme/Plugin'), "default" => get_option("posts_per_page")), "media" => array("label" => __("Show Media", 'Pixelentity Theme/Plugin'), "type" => "RadioUI", "description" => __("Specify if the post's image/video/gallery media is displayed.", 'Pixelentity Theme/Plugin'), "options" => PeGlobal::$const->data->yesno, "default" => "yes"), "pager" => array("label" => __("Paged Result", 'Pixelentity Theme/Plugin'), "type" => "RadioUI", "description" => __("Display a pager when more posts are found than specified in the 'Maximum' field. ", 'Pixelentity Theme/Plugin'), "options" => PeGlobal::$const->data->yesno, "default" => "yes"), "sticky" => array("label" => __("Include Sticky Posts", 'Pixelentity Theme/Plugin'), "type" => "RadioUI", "description" => __("Include sticky posts in the displayed list.", 'Pixelentity Theme/Plugin'), "options" => PeGlobal::$const->data->yesno, "default" => "yes"), "category" => array("label" => __("Category", 'Pixelentity Theme/Plugin'), "type" => "Select", "description" => __("Only show posts from a specific category.", 'Pixelentity Theme/Plugin'), "options" => array_merge(array(__("All", 'Pixelentity Theme/Plugin') => ""), peTheme()->data->getTaxOptions("category")), "default" => ""), "tag" => array("label" => __("Tag", 'Pixelentity Theme/Plugin'), "type" => "Select", "description" => __("Only show posts with a specific tag.", 'Pixelentity Theme/Plugin'), "options" => array_merge(array(__("All", 'Pixelentity Theme/Plugin') => ""), peTheme()->data->getTaxOptions("post_tag")), "default" => ""), "format" => array("label" => __("Post Format", 'Pixelentity Theme/Plugin'), "type" => "Select", "description" => __("Only show posts of a specific format.", 'Pixelentity Theme/Plugin'), "options" => array_merge(array(__("All", 'Pixelentity Theme/Plugin') => ""), array_combine(PeGlobal::$config["post-formats"], PeGlobal::$config["post-formats"])), "default" => "")));
if (count(PeGlobal::$config["blog"]) < 2) {
unset($this->metabox["content"]["layout"]);
}
}
开发者ID:JeffreyBue,项目名称:jb,代码行数:7,代码来源:PeThemeConstantBlog.php
示例7: container
public function container($atts, $content = null, $code = "")
{
$this->instances++;
$content = $this->parseContent($content);
if (!is_array($this->items) || count($this->items) == 0) {
return "";
}
$count = 1;
$commonID = "accordion" . $this->instances;
$html = "";
if (peTheme()->template->exists("shortcode", "accordion")) {
$items = $this->items;
$conf = (object) compact("atts", "content", "items");
ob_start();
peTheme()->template->get_part($conf, "shortcode", "accordion");
$html = ob_get_clean();
} else {
while ($item = array_shift($this->items)) {
$id = "{$commonID}_{$count}";
$html .= '<div class="accordion-group">';
$html .= sprintf('<div class="accordion-heading"><a class="accordion-toggle" href="#%s" data-parent="#%s" data-toggle="collapse">%s</a></div>', $id, $commonID, $item->title);
$html .= sprintf('<div id="%s" class="accordion-body%s"><div class="accordion-inner">%s</div></div>', $id, $count > 1 ? " collapse" : " in", $item->body);
$html .= '</div>';
$count++;
}
}
$html = sprintf('<div id="%s" class="accordion">%s</div>', $commonID, $html);
return apply_filters("pe_theme_shortcode_accordion", $html, $atts, $content, $commonID);
}
开发者ID:JeffreyBue,项目名称:jb,代码行数:29,代码来源:PeThemeShortcodeBS_Accordion.php
示例8: output
public function output($conf)
{
$settings = (object) $conf["data"];
printf('<div class="pe-block%s">', $settings->margin === "no" ? " nomargin" : "");
peTheme()->view->resize($settings);
print "</div>";
}
开发者ID:JeffreyBue,项目名称:jb,代码行数:7,代码来源:PeThemeViewLayoutModuleView.php
示例9: registerAssets
public function registerAssets()
{
parent::registerAssets();
// prototype.js alters JSON2 behaviour, it shouldn't be loaded in our admin page anyway but
// if other plugins are forcing it in all wordpress admin pages, we get rid of it here.
wp_deregister_script("prototype");
if (version_compare($GLOBALS["wp_version"], '3.5-RC1', '<')) {
// for wordpress < 3.5, the bundled jquery ui is not able to handle correctly the nested sortables
// so we load a newer version in noconflict mode and only use for our layout builder
PeThemeAsset::addScript("framework/js/admin/3.5/jquery.js", array(), "pe_theme_35_jquery");
PeThemeAsset::addScript("framework/js/admin/3.5/jquery-ui-1.9.2.custom.min.js", array("pe_theme_35_jquery"), "pe_theme_35_ui");
PeThemeAsset::addScript("framework/js/admin/3.5/noconflict.js", array("pe_theme_35_ui"), "pe_theme_35");
wp_enqueue_script("pe_theme_35");
}
PeThemeAsset::addStyle("framework/css/jquery.theme.field.layout.css", array("pe_theme_admin"), "pe_theme_field_layout");
PeThemeAsset::addScript("framework/js/admin/jquery.theme.field.layout.js", array("pe_theme_utils", "jquery-ui-sortable", "pe_theme_tooltip", "json2"), "pe_theme_field_layout");
wp_enqueue_style("pe_theme_field_layout");
wp_enqueue_script("pe_theme_field_layout");
$views = array();
// modules
foreach (peTheme()->view->views() as $view) {
if ($view->capability("layout")) {
$view->registerAssets();
$views[] = $view;
}
}
foreach ($views as $view) {
$view->requireAssets();
}
}
开发者ID:GaryJones,项目名称:TPWP,代码行数:30,代码来源:PeThemeFormElementLayout.php
示例10: container
public function container($atts, $content = null, $code = "")
{
$this->instances++;
$content = $this->parseContent($content);
$head = $body = "";
if (!is_array($this->items) || count($this->items) == 0) {
return "";
}
$count = 1;
$commonID = "tab" . $this->instances . "_";
if (peTheme()->template->exists("shortcode", "tab")) {
$items = $this->items;
$conf = (object) compact("atts", "content", "items");
ob_start();
peTheme()->template->get_part($conf, "shortcode", "tab");
$html = ob_get_clean();
$this->items = array();
} else {
while ($tab = array_shift($this->items)) {
$id = "{$commonID}_{$count}";
$head .= sprintf('<li%s><a href="#%s" data-toggle="tab">%s</a></li>', $count == 1 ? ' class="active"' : '', $id, $tab->title);
$body .= sprintf('<div class="tab-pane%s" id="%s">%s</div>', $count == 1 ? ' active' : '', $id, $tab->body);
$count++;
}
$html = <<<EOL
\t<ul class="nav nav-tabs">
\t\t{$head}
\t</ul>
\t<div class="tab-content">
\t\t{$body}
\t</div>
EOL;
}
return $html;
}
开发者ID:JeffreyBue,项目名称:jb,代码行数:35,代码来源:PeThemeShortcodeBS_Tabs.php
示例11: template
public function template($type = "")
{
if ($type != "empty") {
peTheme()->get_template_part("view", "portfolio");
//peTheme()->get_template_part("view","portfolio-masonary");
}
}
开发者ID:JeffreyBue,项目名称:jb,代码行数:7,代码来源:PeThemeViewPortfolio.php
示例12: __construct
public function __construct()
{
$this->all = peTheme()->video->option();
$this->fields = new StdClass();
$description = current($this->all) < 0 ? sprintf(__('<a href="%s">Create a new Video</a>', 'Pixelentity Theme/Plugin'), admin_url('post-new.php?post_type=video')) : __("Select which video to use", 'Pixelentity Theme/Plugin');
$this->fields->id = array("label" => __("Use video", 'Pixelentity Theme/Plugin'), "type" => "Select", "description" => $description, "options" => $this->all, "default" => "");
$this->metaboxPost = array("title" => __("Video Options", 'Pixelentity Theme/Plugin'), "where" => array("post" => "video"), "content" => array("id" => $this->fields->id));
}
开发者ID:JeffreyBue,项目名称:jb,代码行数:8,代码来源:PeThemeConstantVideo.php
示例13: template
public function template()
{
if ($this->loop) {
$t =& peTheme();
$t->get_template_part("viewmodule", $this->templateName());
$t->content->resetLoop();
}
}
开发者ID:JeffreyBue,项目名称:jb,代码行数:8,代码来源:PeThemeViewLayoutModuleServices.php
示例14: template
public function template()
{
$t =& peTheme();
if ($loop = $t->data->customLoop($this->data)) {
$t->template->data($this->data, $this->conf->bid);
$t->get_template_part("viewmodule", $this->templateName());
$t->content->resetLoop();
}
}
开发者ID:lukesmmr,项目名称:lowconstrutores,代码行数:9,代码来源:PeThemeViewLayoutModuleThreadBlogAlternate.php
示例15: output
public function output($atts, $content = null, $code = "")
{
extract(shortcode_atts(array('id' => ''), $atts));
$t =& peTheme();
ob_start();
$t->project->portfolio($id);
$content =& ob_get_clean();
return $content;
}
开发者ID:JeffreyBue,项目名称:jb,代码行数:9,代码来源:PeThemeShortcodeBS_Portfolio.php
示例16: template
public function template($type = '')
{
if ('empty' == $type) {
return;
}
print '<div class="pe-container pe-block">';
peTheme()->get_template_part("view", "carousel");
print '</div>';
}
开发者ID:lukesmmr,项目名称:lowconstrutores,代码行数:9,代码来源:PeThemeViewCarousel.php
示例17: __construct
public function __construct($master)
{
parent::__construct($master);
$this->trigger = "hero";
$this->group = __("LAYOUT", 'Pixelentity Theme/Plugin');
$this->name = __("Hero Unit", 'Pixelentity Theme/Plugin');
$this->description = __("Add an Hero Unit", 'Pixelentity Theme/Plugin');
$this->fields = array("type" => array("label" => __("Hero Unit Type", 'Pixelentity Theme/Plugin'), "type" => "Select", "description" => __("Select the type of hero unit required. the type determines the color", 'Pixelentity Theme/Plugin'), "options" => array(__("Default", 'Pixelentity Theme/Plugin') => "default", __("Primary", 'Pixelentity Theme/Plugin') => "primary", __("Info", 'Pixelentity Theme/Plugin') => "info", __("Success", 'Pixelentity Theme/Plugin') => "success", __("Warning", 'Pixelentity Theme/Plugin') => "warning", __("Danger", 'Pixelentity Theme/Plugin') => "danger", __("Inverse", 'Pixelentity Theme/Plugin') => "inverse"), "default" => "default"), "title" => array("label" => __("Title", 'Pixelentity Theme/Plugin'), "type" => "Text", "description" => __("Enter the title of the Hero Unit.", 'Pixelentity Theme/Plugin')), "content" => array("label" => __("Content", 'Pixelentity Theme/Plugin'), "type" => "Editor", "description" => __("Enter the Hero Unit content here.", 'Pixelentity Theme/Plugin')));
peTheme()->shortcode->blockLevel[] = $this->trigger;
}
开发者ID:JeffreyBue,项目名称:jb,代码行数:10,代码来源:PeThemeShortcodeBS_Hero.php
示例18: __construct
public function __construct()
{
$this->all = $this->all =& peTheme()->project->option();
$this->metabox = array("title" => __("Project", 'Pixelentity Theme/Plugin'), "priority" => "core", "type" => "Project", "where" => array("project" => "all"), "content" => array("subtitle" => array("label" => __("Subtitle", 'Pixelentity Theme/Plugin'), "type" => "Text", "description" => __("Specify a project subtitle. This will be shown on the portfolio single column page as well as the single project pages. ", 'Pixelentity Theme/Plugin'), "default" => 'Subtitle here'), "icon" => array("label" => __("Icon", 'Pixelentity Theme/Plugin'), "type" => "Select", "description" => __("Select an icon which represents the contents or theme of this project. This icon will be shown on all portfolio and project pages. ", 'Pixelentity Theme/Plugin'), "options" => apply_filters("pe_theme_project_icons", array(__("Image", 'Pixelentity Theme/Plugin') => "icon-picture", __("Film", 'Pixelentity Theme/Plugin') => "icon-film", __("Video", 'Pixelentity Theme/Plugin') => "icon-facetime-video", __("Music", 'Pixelentity Theme/Plugin') => "icon-music", __("File", 'Pixelentity Theme/Plugin') => "icon-file", __("Review", 'Pixelentity Theme/Plugin') => "icon-search", __("List", 'Pixelentity Theme/Plugin') => "icon-list", __("Thumbnails", 'Pixelentity Theme/Plugin') => "icon-th", __("Book", 'Pixelentity Theme/Plugin') => "icon-book", __("Photography", 'Pixelentity Theme/Plugin') => "icon-camera", __("Typography", 'Pixelentity Theme/Plugin') => "icon-font", __("Private", 'Pixelentity Theme/Plugin') => "icon-lock", __("Info", 'Pixelentity Theme/Plugin') => "icon-info-sign", __("Event", 'Pixelentity Theme/Plugin') => "icon-calendar", __("Commentary", 'Pixelentity Theme/Plugin') => "icon-comment", __("Announcement", 'Pixelentity Theme/Plugin') => "icon-bullhorn", __("Business", 'Pixelentity Theme/Plugin') => "icon-briefcase", __("World", 'Pixelentity Theme/Plugin') => "icon-globe", __("Location", 'Pixelentity Theme/Plugin') => "icon-map-marker", __("Illustration", 'Pixelentity Theme/Plugin') => "icon-pencil", __("Person", 'Pixelentity Theme/Plugin') => "icon-user")), "default" => apply_filters("pe_theme_project_default_icon", 'icon-picture'))));
$layouts = apply_filters("pe_theme_project_layouts", array());
if (count($layouts) > 0) {
$this->metabox["content"]["layout"] = array("label" => __("Layout", 'Pixelentity Theme/Plugin'), "type" => "Select", "description" => __("Select project layout.", 'Pixelentity Theme/Plugin'), "options" => $layouts, "default" => "right");
}
$this->metaboxFeatured = array("title" => __("Featured Project", 'Pixelentity Theme/Plugin'), "priority" => "core", "where" => array("page" => "page-portfolio"), "content" => array("featured" => array("label" => __("Project", 'Pixelentity Theme/Plugin'), "type" => "Select", "description" => __("Select the project you wish to be featured. (Shown full width at top of page)", 'Pixelentity Theme/Plugin'), "options" => array_merge(array(__("None", 'Pixelentity Theme/Plugin') => ""), $this->all), "default" => "")));
}
开发者ID:JeffreyBue,项目名称:jb,代码行数:10,代码来源:PeThemeConstantProject.php
示例19: getContent
public function getContent(&$instance)
{
$t =& peTheme();
$t->template->data((object) $instance);
$loop = $t->content->customLoop("post", empty($instance["count"]) ? 1 : intval($instance["count"]));
$t->get_template_part("widget", "recentposts");
if ($loop) {
$t->content->resetLoop();
}
}
开发者ID:JeffreyBue,项目名称:jb,代码行数:10,代码来源:PeThemeWidgetRecentPosts.php
示例20: output
public function output($conf)
{
parent::output($conf);
$t =& peTheme();
$loop = $t->view->getViewLoop($conf);
if ($loop) {
$t->template->data($conf, $loop);
$this->template();
}
}
开发者ID:JeffreyBue,项目名称:jb,代码行数:10,代码来源:PeThemeViewGallery.php
注:本文中的peTheme函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论