public static function updater_move_legacy_templates()
 {
     /* move copy of legacy core templates to the uploads folder and delete from core templates directory */
     $templates_to_move = array('rsvp-envelope', 'super-slick');
     chmod(LANDINGPAGES_UPLOADS_PATH, 0755);
     $template_paths = lp_get_core_template_paths();
     if (count($template_paths) > 0) {
         foreach ($template_paths as $name) {
             if (in_array($name, $templates_to_move)) {
                 $old_path = LANDINGPAGES_PATH . "templates/{$name}/";
                 $new_path = LANDINGPAGES_UPLOADS_PATH . "{$name}/";
                 /*
                 echo "oldpath: $old_path<br>";
                 echo "newpath: $new_path<br>";
                 */
                 @mkdir($new_path, 0775);
                 chmod($old_path, 0775);
                 self::move_files($old_path, $new_path);
                 rmdir($old_path);
             }
         }
     }
 }
Ejemplo n.º 2
0
    }
    //now add license key inputs to global settings area
    add_filter('lp_define_global_settings', 'lp_add_template_license_keys', 99, 1);
    function lp_add_template_license_keys($lp_global_settings)
    {
        $lp_data = lp_get_extension_data();
        $lp_global_settings['lp-license-keys']['settings'][] = array('id' => 'template-license-keys-header', 'description' => "Head to http://www.inboundnow.com/ to retrieve your license key for this template.", 'type' => 'header', 'default' => '<h3 class="lp_global_settings_header">Template License Keys</h3>');
        foreach ($lp_data as $key => $data) {
            $template_name = $lp_data[$key]['info']['label'];
            $lp_global_settings['lp-license-keys']['settings'][] = array('id' => $key, 'label' => $template_name, 'slug' => $key, 'description' => "Head to http://www.inboundnow.com/ to retrieve your license key for this template.", 'type' => 'license-key');
        }
        return $lp_global_settings;
    }
}
//Now load all config.php files with their custom meta data
$template_paths = lp_get_core_template_paths();
if (count($template_paths) > 0) {
    foreach ($template_paths as $name) {
        if ($name != ".svn" && $name != ".git") {
            include_once LANDINGPAGES_PATH . "/templates/{$name}/config.php";
        }
    }
}
/**
 * DECLARE HELPER FUNCTIONS
 */
function lp_get_extension_data()
{
    global $lp_data;
    //add core settings to main tab
    $parent_key = 'lp';