Plugin Directory

Changeset 1450431


Ignore:
Timestamp:
07/07/2016 06:44:10 AM (9 years ago)
Author:
rootabout
Message:

updated to 1.1.4 - plugin depends on admin-builder plugin now and saves database and functionality for the admin panel if scroll-to-top-one plugin is uninstalled

Location:
scroll-to-top-one/trunk
Files:
1 deleted
3 edited

Legend:

Unmodified
Added
Removed
  • scroll-to-top-one/trunk/abExport.php

    r1437493 r1450431  
    11<?php
     2     $abError = false;
     3    include_once ABSPATH.'wp-admin/includes/plugin.php';
     4    if (!is_plugin_active('admin-builder/admin-builder.php')) {
     5      if(!function_exists('sample_admin_notice__success'))
     6           {
     7        function sample_admin_notice__success()
     8        {
     9          $pluginInstalled = false;
     10          if (!function_exists('get_plugins')) {
     11            require_once ABSPATH.'wp-admin/includes/plugin.php';
     12          }
     13          $allPlugins = get_plugins();
     14          foreach ($allPlugins as $key => $value) {
     15            if ($key === 'admin-builder/admin_builder.php') {
     16              $pluginInstalled = true;
     17            }
     18           }
     19            if ($pluginInstalled){
     20              if (!is_plugin_active('admin-builder/admin_builder.php')) {
     21                $abError = true;
     22                $url = admin_url();
     23                echo '<div class="notice notice-error is-dismissible">';
     24                echo '<h3>Admin Builder Plugin is not ACTIVE!</h3>';
     25                echo '<p>';
     26                echo 'To get the full functionality , activate Admin Builder from the <a href="'.$url.'/plugins.php">plugins directory</a>.';
     27                echo '</p>';
     28                echo '</div>';
     29              } else {
     30                $theJson = '';
     31              }
     32             } else {
     33              $abError = true;
     34              echo '<div class="notice notice-error is-dismissible">';
     35              echo '<h3>Admin Builder Plugin is not installed!</h3>';
     36              echo '<p>';
     37              echo 'To get the full functionality , install Admin Builder.';
     38              echo '</p>';
     39              echo '<p>';
     40              $plugin_name = 'admin-builder';
     41              $install_link = '<a href="'.esc_url(network_admin_url('plugin-install.php?tab=plugin-information&amp;plugin='.$plugin_name.'&amp;TB_iframe=true&amp;width=600&amp;height=550')).'" class="thickbox" title="More info about '.$plugin_name.'">Install '.$plugin_name.'</a>';
     42              echo $install_link;
     43              echo '</p>';
     44              echo '</div>';
     45             }
     46            }
     47            add_action('admin_notices', 'sample_admin_notice__success');
     48           }
     49           }
     50           if (!$abError) {
    251
    3 $pathToSource = realpath(dirname(__FILE__));
    4    if (strpos($pathToSource, 'themes') !== false) {
    5        //theme
    6    $rootURL = get_template_directory_uri().'/admin-builder-wordpress/';
    7        $rootDIR = get_template_directory().'/admin-builder-wordpress/';
    8    } else {
    9        //plugin
    10      $rootURL = plugin_dir_url(__FILE__).'admin-builder-wordpress/';
    11        $rootDIR = plugin_dir_path(__FILE__).'admin-builder-wordpress/';
     52    $theJson = '{\"menus\":[{\"label\":\"Posts\",\"type\":\"post\",\"name\":\"posts\",\"unique\":true,\"children\":[],\"$$hashKey\":\"object:1669\"},{\"label\":\"Pages\",\"type\":\"page\",\"name\":\"pages\",\"unique\":true,\"children\":[],\"$$hashKey\":\"object:1670\"},{\"label\":\"Scroll To Top One\",\"type\":\"cPage\",\"name\":\"sTTO\",\"unique\":false,\"children\":[{\"label\":\"Tab1\",\"name\":\"tab1\",\"context\":\"normal\",\"priority\":\"default\",\"fields\":[{\"name\":\"buttonStyle\",\"type\":\"select\",\"label\":\"Button Style\",\"description\":\"Select The style of the button background container that will show\",\"selectType\":\"custom\",\"oArr\":[{\"label\":\"Default\",\"value\":\"rEdges\",\"$$hashKey\":\"object:2002\"},{\"label\":\"Round\",\"value\":\"round\",\"$$hashKey\":\"object:2013\"},{\"label\":\"Rounded Edges\",\"value\":\"rEdges\",\"$$hashKey\":\"object:2022\"}],\"$$hashKey\":\"object:1911\"},{\"name\":\"buttonSize\",\"type\":\"select\",\"label\":\"Button Size\",\"description\":\"The size of the Scroll to top Button\",\"selectType\":\"custom\",\"oArr\":[{\"label\":\"Default\",\"value\":\"32x32\",\"$$hashKey\":\"object:604\"},{\"label\":\"64 x 64\",\"value\":\"64\",\"$$hashKey\":\"object:615\"},{\"label\":\"32 x 32\",\"value\":\"32\",\"$$hashKey\":\"object:624\"},{\"label\":\"24 x 24\",\"value\":\"24\",\"$$hashKey\":\"object:633\"},{\"label\":\"20 x 20\",\"value\":\"20\",\"$$hashKey\":\"object:642\"}],\"$$hashKey\":\"object:513\"},{\"name\":\"colorpicker1\",\"type\":\"colorpicker\",\"label\":\"Background Color\",\"description\":\"The background color of the button\",\"format\":\"hex\",\"opacity\":true,\"$$hashKey\":\"object:2064\"},{\"name\":\"customIcon\",\"type\":\"upload\",\"label\":\"Custom Icon\",\"description\":\"Upload a custom image for icon to use\",\"tSizes\":[],\"$$hashKey\":\"object:2173\"},{\"name\":\"cPadding\",\"type\":\"textbox\",\"label\":\"Container Padding\",\"description\":\"Integer. In Pixels. Default 5 (if left empty).\",\"$$hashKey\":\"object:2795\"}],\"$$hashKey\":\"object:1732\"}],\"capability\":\"manage_options\",\"handler\":\"ab_sTTO_handler\",\"pageTitle\":\"Scroll To Top One Settings\",\"$$hashKey\":\"object:1691\"}]}';
     53if(class_exists('generalFunctionality')){
     54    $abGeneral = new generalFunctionality();
     55    $abGeneral->loadNew($theJson,$plugin_folder[$plugin_file]);
     56    }
    1257   }
    13 
    14 $exportFile = $rootDIR.'admin_builder.php';
    15 
    16 if (is_file($exportFile)) {
    17     require_once $exportFile;
    18 }
    19 if (class_exists('loadFromPlugin')) {
    20     $theJson = '{"menus":[{"label":"Posts","type":"post","name":"posts","unique":true,"children":[],"$$hashKey":"object:1669"},{"label":"Pages","type":"page","name":"pages","unique":true,"children":[],"$$hashKey":"object:1670"},{"label":"Scroll To Top One","type":"cPage","name":"sTTO","unique":false,"children":[{"label":"Tab1","name":"tab1","context":"normal","priority":"default","fields":[{"name":"buttonStyle","type":"select","label":"Button Style","description":"Select The style of the button background container that will show","selectType":"custom","oArr":[{"label":"Default","value":"rEdges","$$hashKey":"object:2002"},{"label":"Round","value":"round","$$hashKey":"object:2013"},{"label":"Rounded Edges","value":"rEdges","$$hashKey":"object:2022"}],"$$hashKey":"object:1911"},{"name":"buttonSize","type":"select","label":"Button Size","description":"The size of the Scroll to top Button","selectType":"custom","oArr":[{"label":"Default","value":"32x32","$$hashKey":"object:604"},{"label":"64 x 64","value":"64","$$hashKey":"object:615"},{"label":"32 x 32","value":"32","$$hashKey":"object:624"},{"label":"24 x 24","value":"24","$$hashKey":"object:633"},{"label":"20 x 20","value":"20","$$hashKey":"object:642"}],"$$hashKey":"object:513"},{"name":"colorpicker1","type":"colorpicker","label":"Background Color","description":"The background color of the button","format":"hex","opacity":true,"$$hashKey":"object:2064"},{"name":"customIcon","type":"upload","label":"Custom Icon","description":"Upload a custom image for icon to use","tSizes":[],"$$hashKey":"object:2173"},{"name":"cPadding","type":"textbox","label":"Container Padding","description":"Integer. In Pixels. Default 5 (if left empty).","$$hashKey":"object:2795"}],"$$hashKey":"object:1732"}],"capability":"manage_options","handler":"ab_sTTO_handler","pageTitle":"Scroll To Top One Settings","$$hashKey":"object:1691"}]}';
    21     $lfp = new loadFromPlugin();
    22     $lfp->load($theJson);
    23 }
  • scroll-to-top-one/trunk/readme.txt

    r1437520 r1450431  
    6767Previous Require once was placed incorrectly
    6868
     69= 1.1.4 =
     70Requires admin Builder plugin to work.
     71
    6972== Arbitrary section ==
    7073
  • scroll-to-top-one/trunk/scroll-to-top-one.php

    r1437520 r1450431  
    44  Plugin URI: http://admin-builder.com
    55  Description: Add a custom/dinamic scroll to top button to your site, configure background style (round or rounded, configure color and upload your own icon for the up graphic)
    6   Version: 1.1.3
     6  Version: 1.1.4
    77  Author: rootabout
    88  Author URI: http://admin-builder.com
     
    1010  Text Domain: Scroll To Top One
    1111 */
     12
     13
     14
     15
     16 if (!function_exists('get_plugins')) {
     17
     18   require_once ABSPATH.'wp-admin/includes/plugin.php';
     19}
     20$plugin_folder = get_plugins('/'.plugin_basename(dirname(__FILE__)));
     21$plugin_file = basename((__FILE__));
     22
     23require_once 'abExport.php';
     24
     25
     26
     27
    1228
    1329if (!function_exists('stto_register_style')) {
     
    5066    }
    5167    add_action('wp_footer', 'your_function');
    52 
    5368}
    54 require_once('abExport.php');
Note: See TracChangeset for help on using the changeset viewer.