function pro_nag($note) { if (pl_is_pro()) { return $note; } ob_start(); ?> <div class="alert alert-info"> <button type="button" class="close" data-dismiss="alert" href="#">×</button> <strong><i class="icon-star"></i> Upgrade to Pro!</strong> ( <i class="icon-star-half-empty"></i> You're currently using DMS basic. ) <br/>Activate this site with Pro for additional sections, effects, capabilities and support. <a href="http://www.pagelines.com/DMS" class="btn btn-mini" target="_blank"><i class="icon-thumbs-up"></i> Learn More</a> — <em>Already a Pro?</em> <a href="#" class="btn btn-mini" data-tab-link="account" data-stab-link="pl_account"><i class="icon-star"></i> Activate Site</a> </div> <?php $note .= ob_get_clean(); return $note; }
/** * PageLines Body Classes * * Sets up classes for controlling design and layout and is used on the body tag * */ function pagelines_body_classes() { global $pagelines_addclasses, $plpg, $pl_custom_template; $special_body_class = pl_setting('special_body_class') ? pl_setting('special_body_class') : ''; $classes = array(); $classes[] = $special_body_class; // child theme name $classes[] = sanitize_html_class(strtolower(PL_CHILDTHEMENAME)); // pro $classes[] = pl_is_pro() ? 'pl-pro-version' : 'pl-basic-version'; // for backwards compatiblity, dms is: $classes[] = 'responsive'; $classes[] = 'full_width'; // externally added via global variable (string) if (isset($pagelines_addclasses) && $pagelines_addclasses) { $classes = array_merge($classes, (array) explode(' ', $pagelines_addclasses)); } $template = isset($pl_custom_template['key']) ? $pl_custom_template['key'] : 'none'; $classes[] = sprintf('template-%s', $template); // ensure no duplicates or empties $classes = array_unique(array_filter($classes)); // filter & convert to string $body_classes = join(' ', (array) apply_filters('pagelines_body_classes', $classes)); return $body_classes; }
function before_section($s) { echo pl_source_comment($s->name . ' | Section Template', 2); // Add Comment pagelines_register_hook('pagelines_before_' . $s->id, $s->id); // hook $sid = $s->id; $clone = $s->meta['clone']; $edition = $s->sinfo['edition']; $datas = array(); if (!pl_is_pro()) { $edition = $s->sinfo['edition']; if ($edition == 'pro') { $class[] = 'pro-section'; } } if ($s->level == 0) { $class[] = 'pl-area pl-area-sortable area-tag'; $controls = $this->areas->area_controls($s); $pad_class = 'pl-area-pad'; /* - User Sections Classes - */ if (isset($s->meta['ctemplate'])) { $class[] = 'custom-section editing-locked'; $datas[] = sprintf("data-custom-section='%s'", $s->meta['ctemplate']); $datas[] = sprintf("data-custom-name='%s'", pl_custom_section_name($s->meta['ctemplate'])); } } else { // Content Section Stuff $span = isset($s->meta['span']) ? sprintf('span%s', $s->meta['span']) : 'span12'; $offset = isset($s->meta['offset']) ? sprintf('offset%s', $s->meta['offset']) : 'offset0'; $newrow = isset($s->meta['newrow']) && $s->meta['newrow'] == 'true' ? 'force-start-row' : ''; $class[] = 'pl-section'; $class[] = $span; $class[] = $offset; $class[] = $newrow; $controls = $this->editor->section_controls($s); $pad_class = 'pl-section-pad'; } $styles = $s->wrapper_styles; $class = array_merge($class, $s->wrapper_classes, (array) explode(' ', $s->special_classes)); $class = array_unique(array_filter($class)); // ensure no empties or duplicates $video = pl_standard_video_bg($s); $title = !$s->alt_standard_title ? $s->opt('pl_standard_title') : false; if ($title) { $attr = 'class="pl-section-title pla-from-top subtle pl-animation" data-sync="pl_standard_title"'; $title = $s->level == 0 ? sprintf('<h2 %s>%s</h2>', $attr, $title) : sprintf('<h3 %s>%s</h3>', $attr, $title); } printf('<section id="%s" data-object="%s" data-sid="%s" data-clone="%s" %s class="%s section-%s" style="%s">%s%s<div class="%s fix">%s', $s->id . $clone, $s->class_name, $s->id, $clone, implode(" ", $datas), implode(" ", $class), $sid, implode(" ", $styles), $controls, $video, $pad_class, $title); pagelines_register_hook('pagelines_outer_' . $s->id, $s->id); // hook pagelines_register_hook('pagelines_inside_top_' . $s->id, $s->id); // hook }
function activation_check_function() { if (defined('DOING_AJAX') && true == DOING_AJAX) { return; } if (!current_user_can('edit_theme_options')) { return; } if (!pl_is_pro()) { // no need if were not activated return; } $data = get_option('dms_activation', array('active' => false, 'key' => '', 'message' => '', 'email' => '')); if (!isset($data['date'])) { $data['date'] = date('Y-m-d'); } if (isset($data['date']) && $data['date'] > date('Y-m-d') && $data['date'] <= date('Y-m-d', strtotime('+7 days', strtotime($data['date'])))) { return false; } else { $data['date'] = date('Y-m-d'); } $key = isset($data['key']) ? $data['key'] : false; $email = isset($data['email']) ? $data['email'] : false; $url = sprintf('http://www.pagelines.com/index.php?wc-api=software-api&request=%s&product_id=dmspro&licence_key=%s&email=%s&instance=%s', 'check', $key, $email, site_url()); $result = wp_remote_get($url); // if wp_error save error and abort. if (is_wp_error($result)) { $data['last_error'] = $result->get_error_message(); update_option('dms_activation', $data); return false; } else { $data['last_error'] = ''; update_option('dms_activation', $data); } // do a couple of sanity checks.. if (!is_array($result)) { return false; } if (!isset($result['body'])) { return false; } $rsp = json_decode($result['body']); if (!is_object($rsp)) { return false; } if (!isset($rsp->success)) { return false; } // if success is true means the key was valid, move along nothing to see here. if (true == $rsp->success) { $data['date'] = date('Y-m-d', strtotime('+7 days', strtotime($data['date']))); update_option('dms_activation', $data); return; } if (isset($rsp->error) && isset($rsp->code)) { // lets try again tomorrow $data['date'] = date('Y-m-d', strtotime('+1 days', strtotime($data['date']))); $data['trys'] = isset($data['trys']) ? $data['trys'] + 1 : 1; update_option('dms_activation', $data); if ($data['trys'] < 3) { // try 2 times. return; } self::send_email($rsp, $data); } }
function add_new_callback() { $this->xlist = new EditorXList(); //$this->extensions = new EditorExtensions; $this->page = new PageLinesPage(); $filter_local = array('component' => __('Components', 'pagelines'), 'layout' => __('Layouts', 'pagelines'), 'full-width' => __('Full Width', 'pagelines'), 'format' => __('Post Layouts', 'pagelines'), 'gallery' => __('Galleries', 'pagelines'), 'navigation' => __('Navigation', 'pagelines'), 'slider' => __('Sliders', 'pagelines'), 'social' => __('Social', 'pagelines'), 'widgetized' => __('Widgetized', 'pagelines'), 'misc' => __('Miscellaneous', 'pagelines')); $sections = $this->get_available_sections(); $list = ''; $count = 1; foreach ($sections as $key => $s) { $img = sprintf('<img src="%s" style=""/>', $s->screenshot); if ($s->map != '') { $map = json_encode($s->map); $special_class = 'section-plcolumn'; } else { $map = ''; $special_class = ''; } if ($s->filter == 'deprecated') { continue; } $full_width_classes = 'pl-area-sortable area-tag'; $content_width_classes = 'pl-sortable span12 sortable-first sortable-last'; $full_width = strpos($s->filter, 'full-width') !== false ? true : false; $content_width = strpos($s->filter, 'content-width') !== false ? true : false; $dual_loading = strpos($s->filter, 'dual-width') !== false ? true : false; $section_classes = $full_width ? $full_width_classes : $content_width_classes; $name = stripslashes($s->name); $desc = array(); // Start Class Array (all classes on section icon) $class = array('x-add-new'); $class['section'] = $section_classes; $class['special'] = $special_class; $filters = explode(',', $s->filter); foreach ($filters as $f) { $class['filter-' . $f] = $f; $desc[] = isset($filter_local[trim($f)]) ? $filter_local[trim($f)] : ucwords(trim($f)); } $desc = join(', ', $desc); $number = $count++; if (!empty($s->isolate)) { $disable = true; foreach ($s->isolate as $isolation) { if ($isolation == 'posts_pages' && $this->page->is_posts_page()) { $disable = false; } elseif ($isolation == '404_page' && is_404()) { $disable = false; } elseif ($isolation == 'single' && !$this->page->is_special()) { $disable = false; } elseif ($isolation == 'author' && 'author' == $this->page->type()) { $disable = false; } } if ($disable) { $class['disable'] = 'x-disable'; $number += 100; } } if (!pl_is_pro() && !empty($s->sinfo['edition']) && !empty($s->sinfo['edition']) == 'pro') { $class['disable'] = 'x-disable'; $desc = __('<span class="badge badge-important">PRO ONLY</span>', 'pagelines'); } $data_array = array('object' => $s->class_name, 'sid' => $s->id, 'name' => $name, 'image' => $s->screenshot, 'clone' => pl_new_clone_id(), 'number' => $number); if (!empty($s->loading)) { $class['loading'] = 'loading-' . $s->loading; } if (!empty($s->ctemplate)) { $class['custom'] = 'custom-section'; $data_array['custom-section'] = $s->ctemplate; } if (!empty($map)) { $data_array['template'] = $map; } $args = array('id' => $s->id, 'class_array' => $class, 'data_array' => $data_array, 'thumb' => $s->screenshot, 'name' => $name, 'sub' => $full_width ? __('Full Width', 'pagelines') : __('Content Width', 'pagelines')); $list .= $this->xlist->get_x_list_item($args); if ($dual_loading) { $args['class_array']['section'] = $full_width_classes; $args['class_array'][] = 'full-width'; $args['name'] = $name . ' (Full)'; $args['sub'] = __('Full Width', 'pagelines'); $list .= $this->xlist->get_x_list_item($args); } } printf('<div class="x-list x-sections" data-panel="x-sections">%s</div>', $list); }