本文整理汇总了PHP中common_node类的典型用法代码示例。如果您正苦于以下问题:PHP common_node类的具体用法?PHP common_node怎么用?PHP common_node使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了common_node类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: mainAction
/**
* main action
*/
public function mainAction()
{
/**
* initialise node and get detail
*/
require_once 'models/common/common_node.php';
$Node = new common_node();
$node_data = $Node->nodeDetail($this->GET['id']);
/**
* get node component options
*/
if ($node_data['component']['provider'] == '') {
$node_data['component']['provider'] = 'vimeo';
}
if ($node_data['component']['autoplay']) {
$autoplay_param = ":autoplay=1";
} else {
$autoplay_param = '';
}
/**
* pass to menu component
*/
$Onxshop_Request = new Onxshop_Request("component/video_{$node_data['component']['provider']}~video_id={$node_data['component']['video_id']}{$autoplay_param}~");
$this->tpl->assign("VIDEO", $Onxshop_Request->getContent());
$this->tpl->assign("NODE", $node_data);
if ($node_data['display_title']) {
$this->tpl->parse('content.title');
}
return true;
}
示例2: parseContentTagsBeforeHook
/**
* hook before parsing
*/
public function parseContentTagsBeforeHook()
{
parent::parseContentTagsBeforeHook();
/**
* pass GET.recipe_id into template
*/
$Node = new common_node();
$node_data = $Node->nodeDetail($this->GET['id']);
$this->GET['recipe_id'] = $node_data['content'];
/**
* pass GET.taxonomy_ids into template
*/
$Recipe_Taxonomy = new ecommerce_recipe_taxonomy();
$taxonomy_ids = (array) $Recipe_Taxonomy->getRelationsToRecipe($this->GET['recipe_id']);
$this->GET['taxonomy_tree_id'] = implode(",", $taxonomy_ids);
/**
* rating & reviews
*/
require_once 'models/ecommerce/ecommerce_recipe_review.php';
$Review = new ecommerce_recipe_review();
$review_data = $Review->getRating($this->GET['recipe_id']);
if ($review_data['count'] > 0) {
$rating = round($review_data['rating']);
$_Onxshop_Request = new Onxshop_Request("component/rating_stars~rating={$rating}~");
$this->tpl->assign('RATING_STARS', $_Onxshop_Request->getContent());
if ($review_data['count'] == 1) {
$this->tpl->assign('REVIEWS', 'Review');
} else {
$this->tpl->assign('REVIEWS', 'Reviews');
}
$this->tpl->assign('REVIEW', $review_data);
$this->tpl->parse('content.reviews');
}
}
示例3: mainAction
/**
* main action
*/
public function mainAction()
{
/**
* get input
*/
$node_id = $this->GET['node_id'];
$type = $this->GET['type'];
/**
* check value
*/
if (!is_numeric($node_id)) {
return false;
}
/**
* initialize
*/
require_once 'models/common/common_node.php';
$Node = new common_node();
/**
* increment value
*/
$Node->incrementShareCounter($node_id);
/**
* if user is logged in save action
*/
$this->saveClientAction($node_id, $type);
return true;
}
示例4: mainAction
/**
* main action
*/
public function mainAction()
{
set_time_limit(0);
require_once 'models/common/common_node.php';
$Node = new common_node();
$sitemap = $Node->getFlatSitemap();
if (is_array($sitemap)) {
if ($_SERVER['SSL_PROTOCOL'] || $_SERVER['HTTPS']) {
$protocol = 'https';
} else {
$protocol = 'http';
}
foreach ($sitemap as $node) {
$link = $Node->getSeoURL($node['id']);
$item['loc'] = "{$protocol}://{$_SERVER['HTTP_HOST']}{$link}";
$item['lastmod'] = $Node->getLastMod($node['id'], $node['modified']);
$item['lastmod'] = substr($item['lastmod'], 0, 10);
if ($node['parent'] == $Node->conf['id_map-global_navigation'] || $node['parent'] == $Node->conf['id_map-primary_navigation'] || $node['parent'] == $Node->conf['id_map-footer_navigation']) {
$item['priority'] = 1;
} else {
$item['priority'] = 0.5;
}
$this->tpl->assign("ITEM", $item);
$this->tpl->parse("content.item");
}
}
header('Content-Type: text/xml; charset=UTF-8');
return true;
}
示例5: mainAction
/**
* main action
*/
public function mainAction()
{
if (isset($this->GET['search'])) {
$searchQuery = $this->GET['search']['query'];
$count = strlen(trim($searchQuery));
if ($count > 2) {
require_once 'models/common/common_node.php';
$Node = new common_node();
$result = $Node->search($searchQuery);
$added = array();
foreach ($result as $r) {
if ($r['node_group'] != 'page') {
$active_pages = $Node->getActivePages($r['id']);
$r = $Node->detail($active_pages[0]);
}
if (!in_array($r['id'], $added) && $r['node_group'] == 'page') {
$this->tpl->assign('RESULT', $r);
$this->tpl->parse('content.result.item');
$added[] = $r['id'];
}
}
$this->tpl->parse('content.result');
} else {
msg("Please specify at least 3 characters", "error");
}
}
return true;
}
示例6: mainAction
/**
* main action
*/
public function mainAction()
{
require_once 'models/common/common_node.php';
require_once 'models/ecommerce/ecommerce_product.php';
$Node = new common_node();
$Product = new ecommerce_product();
$product_id = $this->GET['id'];
//listing
if (is_numeric($product_id)) {
$current = $Product->findProductInNode($product_id);
$this->tpl->assign('NODE', $Node->detail($current[0]['id']));
foreach ($current as $key => $node_data) {
//don't display homepage
if ($key > 0) {
if ($node_data['publish'] == 0) {
$node_data['class'] = "class='disabled'";
}
$this->tpl->assign("ITEM", $node_data);
$_Onxshop_Request = new Onxshop_Request("component/breadcrumb~id={$node_data['id']}:create_last_link=1~");
$this->tpl->assign('BREADCRUMB', $_Onxshop_Request->getContent());
$this->tpl->parse("content.multiple.item");
}
}
if (count($current) > 1) {
$this->tpl->parse('content.multiple');
}
}
return true;
}
示例7: mainAction
/**
* main action
*/
public function mainAction()
{
require_once 'models/common/common_node.php';
$Node = new common_node();
$news_list_detail = $Node->getDetail($this->GET['blog_node_id']);
$this->tpl->assign("NEWS_LIST", $news_list_detail);
$node_data = $_POST['node'];
if ($_POST['save']) {
/**
* pre-populate content
*/
$node_data['description'] = 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.';
$node_data['content'] = '
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
<ul>
<li>velit esse cillum dolore</li>
<li>consectetur adipisicing elit</li>
<li>occaecat cupidatat non proident</li>
</ul>
<p>Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
';
/**
* insert a new node
*/
if ($id = $Node->nodeInsert($node_data)) {
msg(ucfirst($node_data['node_group']) . " has been added.");
//quick pages builder
//$Page_builder = new Onxshop_Request("bo/page_builder@blank&parent=$id&node_group={$node_data['node_group']}&node_controller={$node_data['node_controller']}");
}
}
$this->tpl->assign('NODE', $node_data);
return true;
}
示例8: mainAction
/**
* main action
*/
public function mainAction()
{
require_once 'models/common/common_node.php';
$Node = new common_node();
$node_data = $Node->nodeDetail($this->GET['id']);
require_once 'models/common/common_file.php';
$File = new common_file();
if (is_numeric($this->GET['id'])) {
$files = $File->listFiles($this->GET['id']);
}
if (is_array($files)) {
foreach ($files as $file) {
$this->tpl->assign('FILE', $file);
$this->tpl->parse('content.item');
}
}
$this->tpl->assign('NODE', $node_data);
/**
* display title
*/
if ($node_data['display_title']) {
if ($node_data['link_to_node_id'] > 0) {
$this->tpl->parse('content.title_link');
} else {
$this->tpl->parse('content.title');
}
}
return true;
}
示例9: getList
/**
* get list
*/
public function getList($publish = 1)
{
require_once 'models/common/common_node.php';
/**
* what node elements to display?
*/
if ($this->GET['parent_type'] !== '') {
switch ($this->GET['parent_type']) {
case 'layout':
$node_group = 'page';
break;
case 'content':
$node_group = 'layout';
break;
case 'page':
default:
$node_group = 'page';
break;
}
} else {
$node_group = 'page';
}
$Node = new common_node();
$list = $Node->getTree(0, $node_group);
return $list;
}
示例10: mainAction
/**
* main action
*/
public function mainAction()
{
/**
* check input variables
*/
if (is_numeric($_POST['node_id'])) {
$node_id = $_POST['node_id'];
} else {
msg("node_bin: node_id is not numeric", 'error');
return false;
}
/**
* initialise Node object
*/
require_once 'models/common/common_node.php';
$Node = new common_node();
/**
* the request seems to be valid, try to bin the node
*/
if ($Node->moveToBin($node_id)) {
msg("Node (id={$node_id}) moved to Bin", 'ok');
} else {
msg("Cannot move Node (id={$node_id}) to Bin", 'error');
}
return true;
}
示例11: mainAction
/**
* main action
*/
public function mainAction()
{
$node_id = $this->GET['node_id'];
if (!is_numeric($node_id)) {
return false;
}
if ($this->GET['mail_template'] && trim($this->GET['mail_template']) != '') {
$this->mail_template = $this->GET['mail_template'];
} else {
$this->mail_template = 'notify_author';
}
$this->tpl->assign('MAIL_TEMPLATE', $this->mail_template);
require_once 'models/common/common_node.php';
$Node = new common_node();
$node_detail = $Node->getDetail($node_id);
$this->tpl->assign('NODE', $node_detail);
$this->tpl->assign('CONF', $GLOBALS['onxshop_conf']);
if ($this->GET['confirm'] == 1) {
$this->sendEmail($node_detail);
} else {
$this->previewEmail($node_detail);
}
$this->showPreviouslySentEmails($node_detail['author_detail']['email']);
return true;
}
示例12: mainAction
/**
* main action
*/
public function mainAction()
{
require_once 'models/common/common_node.php';
$Node = new common_node();
//get data
$node_data = $Node->nodeDetail($this->GET['id']);
$rss_options = $node_data['component'];
//detect feed specific controller
if (preg_match('/api.twitter.com/', $rss_options['url'])) {
$feed_controller = 'feed_twitter';
} else {
$feed_controller = 'feed';
}
$this->tpl->assign('FEED_CONTROLLER', $feed_controller);
//prepare data
$rss_options['url'] = base64_encode(urlencode(trim($rss_options['url'])));
//get RSS_RESULT
$nsite_request = "component/{$feed_controller}~url={$rss_options['url']}:items_limit={$rss_options['items_limit']}:channel_title={$rss_options['channel_title']}:image={$rss_options['image']}:copyright={$rss_options['copyright']}:description={$rss_options['description']}:content={$rss_options['content']}:pubdate={$rss_options['pubdate']}~";
$_Onxshop_Request = new Onxshop_Request($nsite_request);
$this->tpl->assign("RSS_RESULT", $_Onxshop_Request->getContent());
//if ajax option enable, allow to update dynamicaly
if ($rss_options['ajax'] == 1) {
//AJAX METHOD
$this->tpl->assign("RSS_OPTIONS", $rss_options);
$this->tpl->parse('content.ajax');
}
$this->tpl->assign('NODE', $node_data);
if ($node_data['display_title']) {
$this->tpl->parse('content.title');
}
return true;
}
示例13: mainAction
/**
* main action
*/
public function mainAction()
{
require_once 'models/common/common_node.php';
$Node = new common_node();
$node_data = $Node->nodeDetail($this->GET['id']);
if (!is_array($node_data['component'])) {
$node_data['component'] = array();
$node_data['component']['node_controller'] = 'common_simple';
}
if ($node_data['component']['sending_failed'] == '') {
$node_data['component']['sending_failed'] = 'The provided data is not valid! Required items are marked with an asterisk (*)';
}
if ($node_data['component']['text'] == '') {
$node_data['component']['text'] = "Thank you for your feedback.";
}
$this->tpl->assign("NODE", $node_data);
$template_folder = "component/contact_form/";
$template_name = "{$template_folder}{$node_data['component']['node_controller']}";
/**
* check template file exists
*/
if (!templateExists($template_name)) {
// try fallback to old _contact_form folder in case it was locally created (used prior to Onxshop 1.7.6)
$template_folder = "component/_contact_form/";
$template_name = "{$template_folder}{$node_data['component']['node_controller']}";
if (!templateExists($template_name)) {
msg("selected template {$template_name} was not found");
return false;
}
}
/**
* execute controller
*/
$Form = new Onxshop_Request("component/contact_form@{$template_name}&node_id={$node_data['id']}&mail_to={$node_data['component']['mail_to']}&mail_toname={$node_data['component']['mail_toname']}&spam_protection={$node_data['component']['spam_protection']}");
$this->tpl->assign("FORM", $Form->getContent());
$reg_key = "form_notify_" . $node_data['id'];
if (Zend_Registry::isRegistered($reg_key)) {
if (Zend_Registry::get($reg_key) == 'sent') {
//forward
msg($node_data['component']['text'], 'ok');
if ($node_data['component']['href'] != '') {
onxshopGoTo($node_data['component']['href']);
}
} else {
if (Zend_Registry::get($reg_key) == 'failed') {
msg($node_data['component']['sending_failed'], 'error');
$this->tpl->parse('content.form');
} else {
$this->tpl->parse('content.form');
}
}
} else {
$this->tpl->parse('content.form');
}
if ($node_data['display_title']) {
$this->tpl->parse('content.title');
}
return true;
}
示例14: mainAction
/**
* main action
*/
public function mainAction()
{
/**
* initialise node and get detail
*/
require_once 'models/common/common_node.php';
$Node = new common_node();
$node_data = $Node->nodeDetail($this->GET['id']);
/**
* get node component options
*/
switch ($node_data['component']['template']) {
case 'menu_SELECT':
$template = 'component/menu_select';
break;
case 'menu_GRID':
$template = 'component/menu_grid';
break;
case 'menu_STACK':
$template = 'component/menu_stack';
break;
default:
$template = 'component/menu';
}
if (is_numeric($node_data['component']['level'])) {
$level = $node_data['component']['level'];
} else {
$level = 0;
}
if (is_numeric($node_data['component']['display_all'])) {
$display_all = $node_data['component']['display_all'];
} else {
$display_all = 0;
}
if (is_numeric($node_data['component']['open'])) {
$open = $node_data['component']['open'];
} else {
$open = '';
}
/**
* image size
*/
if ($template == 'component/menu_grid' || $template == 'component/menu_stack') {
$image_o = $this->getImageSizeOptions($node_data);
}
/**
* pass to menu component
*/
$Onxshop_Request = new Onxshop_Request("{$template}~id={$node_data['component']['node_id']}:display_teaser={$node_data['component']['display_teaser']}:level={$level}:expand_all={$display_all}:open={$open}:image_width={$image_o['width']}:image_height={$image_o['height']}:image_fill={$image_o['fill']}~");
$this->tpl->assign("MENU", $Onxshop_Request->getContent());
$this->tpl->assign("NODE", $node_data);
if ($node_data['display_title']) {
$this->tpl->parse('content.title');
}
return true;
}
示例15: mainAction
/**
* main action
*/
public function mainAction()
{
/**
* initialise
*/
require_once 'models/common/common_node.php';
$Node = new common_node();
/**
* input data
*/
if (is_numeric($this->GET['blog_node_id'])) {
$blog_node_id = $this->GET['blog_node_id'];
} else {
$blog_node_id = $Node->conf['id_map-blog'];
}
if ($this->GET['date_part'] == 'year-month') {
$date_part = 'year-month';
} else {
$date_part = "year";
}
if (!$this->GET['created']) {
$this->tpl->assign('ACTIVE_CLASS_ALL', 'active');
}
$this->tpl->assign('BLOG_NODE_ID', $blog_node_id);
/**
* process
*/
if ($article_archive = $Node->getBlogArticleArchive($blog_node_id, 1, $date_part)) {
foreach ($article_archive as $item) {
if ($date_part == 'year-month') {
//archive by year-month
$item['created'] = trim($item['date_part'], '()');
$item['created'] = preg_replace('/,/', '-', $item['created']);
//add leading 0 to month 1 to 9 (January to September)
$item['created'] = preg_replace('/^([0-9]{4})-([0-9]{1})$/', '\\1-0\\2', $item['created']);
//formating can be done in template, but in this case formating depends on input
//custom formating can still be done in the template, e.g. {ITEM.created|strtotime|strftime('%B %Y', %s)}
$item['created_formated'] = strftime('%B %Y', strtotime($item['created']));
} else {
//archive by year
$item['created'] = $item['date_part'];
$item['created_formated'] = $item['created'];
}
//active css class
if ($item['created'] == $this->GET['created']) {
$this->tpl->assign('ACTIVE_CLASS', 'active');
} else {
$this->tpl->assign('ACTIVE_CLASS', '');
}
$this->tpl->assign('ITEM', $item);
$this->tpl->parse('content.list.item');
}
$this->tpl->parse('content.list');
}
return true;
}