Exemplo n.º 1
0
function spg_admin()
{
    global $emgplugname, $theshort, $theopt;
    $i = 0;
    $msgicon = plugins_url('images/confirm-check.png', __FILE__);
    if (isset($_REQUEST['saved'])) {
        echo '<script type="text/javascript">
    jQuery(function () {
    jQuery(".infoboxsaveorreset").show("slow");
    });
    </script>';
        $saveresmsg = 'Settings saved...';
    }
    if (isset($_REQUEST['reset'])) {
        echo '<script type="text/javascript">
    jQuery(function () {
    jQuery(".infoboxsaveorreset").show("slow");
    });
    </script>';
        $saveresmsg = 'Settings reset...';
    }
    ?>
<div id="spg_container">
    <div id="header">
      <div class="logo">
      <div class="emg-icon-option-left"></div>
        <div class="emg-cp-title"><h2><?php 
    echo EASYMEDIA_NAME . " (v " . EASYMEDIA_VERSION . ")";
    ?>
</h2></div>
      </div>
      <div class="emg-icon-option-right"> </div>
      <div style="clear: both;"></div>
    </div>

<div id="main">
<div style="width: auto;" class="infoboxdemo"><a target='_blank' href='https://ghozylab.com/plugins/'>Click Here to See Amazing Pro Version DEMO</a></div>
<div class="infoboxsaveorreset"><?php 
    echo $saveresmsg;
    ?>
</div>
<form method="post">
<div class="sps_wrap">
<div class="sps_opts">


<?php 
    settings_fields('easy_options_group');
    ?>

<?php 
    foreach ($theopt as $theval) {
        switch ($theval['type']) {
            case "open":
                ?>
	<?php 
                break;
            case "close":
                ?>
 
</div>
</div>
<br />

 
<?php 
                break;
            case 'text':
                ?>

<div class="sps_input sps_text">
	<label for="<?php 
                echo $theval['id'];
                ?>
"><?php 
                echo $theval['name'];
                ?>
</label>
 	<input name="<?php 
                echo $theval['id'];
                ?>
" id="<?php 
                echo $theval['id'];
                ?>
" type="<?php 
                echo $theval['type'];
                ?>
" value="<?php 
                if (easy_get_option($theval['id']) != "") {
                    echo stripslashes(easy_get_option($theval['id']));
                } else {
                    echo $theval['std'];
                }
                ?>
" />
 <small><?php 
                echo $theval['desc'];
                ?>
</small><div class="clearfix"></div>
 
 </div>
<?php 
                break;
            case 'margin':
                ?>

<div class="sps_input sps_text">
	<label for="<?php 
                echo $theval['id'];
                ?>
"><?php 
                echo $theval['name'];
                ?>
</label>
 	<input style="width:43px !important;" name="<?php 
                echo $theval['id'];
                ?>
" id="<?php 
                echo $theval['id'];
                ?>
" type="text" value="<?php 
                if (easy_get_option($theval['id']) != "") {
                    echo stripslashes(easy_get_option($theval['id']));
                } else {
                    echo $theval['std'];
                }
                ?>
" /> <?php 
                echo $theval['pixopr'];
                ?>
 <small><?php 
                echo $theval['desc'];
                ?>
</small><div class="clearfix"></div>
 
 </div>
<?php 
                break;
            case 'size':
                $default = $theval['std'];
                $sizeall = easy_get_option($theval['id']);
                if (!is_array($sizeall) || empty($sizeall)) {
                    $sizeall = $default;
                }
                ?>
	
<div class="sps_input sps_text">
	<label for="<?php 
                echo $theval['id'];
                ?>
"><?php 
                echo $theval['name'];
                ?>
</label>
   
 	<strong>Width</strong> <input style="margin-left:3px; width:43px !important;" name="<?php 
                echo $theval['id'];
                ?>
[width]" id="<?php 
                echo $theval['id'];
                ?>
[width]" type="text" value="<?php 
                if ($sizeall['width'] != "") {
                    echo stripslashes($sizeall['width']);
                } else {
                    echo $default;
                }
                ?>
" /> <?php 
                echo $theval['pixopr'];
                ?>
    
<span style="border-right:solid 1px #CCC; margin-right:11px; margin-left:9px;"></span>
 	<strong>Height</strong> <input style="margin-left:3px; width:43px !important;" name="<?php 
                echo $theval['id'];
                ?>
[height]" id="<?php 
                echo $theval['id'];
                ?>
[height]" type="text" value="<?php 
                if ($sizeall['height'] != "") {
                    echo stripslashes($sizeall['height']);
                } else {
                    echo $default;
                }
                ?>
" /> <?php 
                echo $theval['pixopr'];
                ?>

 <small><?php 
                echo $theval['desc'];
                ?>
</small><div class="clearfix"></div>
 
 </div>
<?php 
                break;
            case 'textarea':
                ?>

<div class="sps_input sps_textarea">
	<label for="<?php 
                echo $theval['id'];
                ?>
"><?php 
                echo $theval['name'];
                ?>
</label>
 	<textarea style="vertical-align:top !important;" name="<?php 
                echo $theval['id'];
                ?>
" type="<?php 
                echo $theval['type'];
                ?>
" cols="" rows=""><?php 
                if (easy_get_option($theval['id']) != "") {
                    echo stripslashes(easy_get_option($theval['id']));
                } else {
                    echo $theval['std'];
                }
                ?>
</textarea>
 <small><?php 
                echo $theval['desc'];
                ?>
</small><div class="clearfix"></div>
 
 </div>
  
<?php 
                break;
            case 'textareainfo':
                ?>

<div class="sps_input sps_textarea">
	<label for="<?php 
                echo $theval['id'];
                ?>
"><?php 
                echo $theval['name'];
                ?>
</label>
 	<textarea id="emgwpinfo" style="vertical-align:top !important;" name="<?php 
                echo $theval['id'];
                ?>
" type="<?php 
                echo $theval['type'];
                ?>
" cols="" rows="" readonly><?php 
                echo easmedia_get_wpinfo();
                ?>
</textarea>
 <small><?php 
                echo $theval['desc'];
                ?>
</small><div class="clearfix"></div>
 
 </div>
  
<?php 
                break;
            case 'select':
                ?>

<div class="sps_input sps_select">
	<label for="<?php 
                echo $theval['id'];
                ?>
"><?php 
                echo $theval['name'];
                ?>
</label>
	
<select name="<?php 
                echo $theval['id'];
                ?>
" id="<?php 
                echo $theval['id'];
                ?>
">
<?php 
                foreach ($theval['options'] as $option) {
                    ?>
		<option <?php 
                    if (easy_get_option($theval['id']) == $option) {
                        echo 'selected="selected"';
                    }
                    ?>
><?php 
                    echo $option;
                    ?>
</option><?php 
                }
                ?>
</select>

	<small><?php 
                echo $theval['desc'];
                ?>
</small><div class="clearfix"></div>
</div>
<?php 
                break;
            case "checkbox":
                ?>

<div class="sps_input sps_checkbox">
	<label for="<?php 
                echo $theval['id'];
                ?>
"><?php 
                echo $theval['name'];
                ?>
</label>
<?php 
                easy_get_option($theval['id']) == 1 ? $checked = 'checked="checked"' : ($checked = '');
                ?>
<input name="<?php 
                echo $theval['id'];
                ?>
" id="<?php 
                echo $theval['id'];
                ?>
" class="switch" type="checkbox" <?php 
                echo $checked;
                ?>
 value="1"></input>
	<small><?php 
                echo $theval['desc'];
                ?>
</small><div class="clearfix"></div>
 
 </div>

<?php 
                break;
            case 'slider':
                ?>

<div class="sps_input">
	<label for="<?php 
                echo $theval['id'];
                ?>
"><?php 
                echo $theval['name'];
                ?>
</label>
	
    <div id="<?php 
                echo $theval['id'];
                ?>
_slider" ></div><input style="margin-left:10px; width:43px !important;" name="<?php 
                echo $theval['id'];
                ?>
" id="<?php 
                echo $theval['id'];
                ?>
" type="text" value="<?php 
                if (easy_get_option($theval['id']) != "") {
                    echo stripslashes(easy_get_option($theval['id']));
                } else {
                    echo $theval['std'];
                }
                ?>
" /> <?php 
                echo $theval['pixopr'];
                ?>

	<small><?php 
                echo $theval['desc'];
                ?>
</small><div class="clearfix"></div>
</div>
<?php 
                break;
            case "color":
                ?>

<div class="sps_input sps_text">
<label for="<?php 
                echo $theval['id'];
                ?>
"><?php 
                echo $theval['name'];
                ?>
</label>

<div id="<?php 
                echo $theval['id'];
                ?>
_picker" class="colorSelector"><div></div></div>
<input style="margin-left:3px; width:75px !important;" name="<?php 
                echo $theval['id'];
                ?>
" id="<?php 
                echo $theval['id'];
                ?>
" type="text" value="<?php 
                if (easy_get_option($theval['id']) != "") {
                    echo stripslashes(easy_get_option($theval['id']));
                } else {
                    echo $theval['std'];
                }
                ?>
" />
<small><?php 
                echo $theval['desc'];
                ?>
</small>
<div class="clearfix"></div>
</div>


<?php 
                break;
            case 'pattern':
                ?>

<div class="sps_input">
	<label style="vertical-align:top !important;" for="<?php 
                echo $theval['id'];
                ?>
"><?php 
                echo $theval['name'];
                ?>
</label>
    <input type="hidden" value="<?php 
                if (easy_get_option($theval['id']) != "") {
                    echo stripslashes(easy_get_option($theval['id']));
                } else {
                    echo $theval['std'];
                }
                ?>
" name="<?php 
                echo $theval['id'];
                ?>
" id="<?php 
                echo $theval['id'];
                ?>
" />
    
    <div class="pattern_box">
    
                	<div style="float: left;" class="pattern_overlay <?php 
                if (!easy_get_option($theval['id']) || easy_get_option($theval['id']) == 'none') {
                    echo 'pattern_selected';
                }
                ?>
" id="no_pattern"> no pattern </div>
    
                <?php 
                foreach (easmedia_patterns_ls() as $pattern) {
                    easy_get_option($theval['id']) == $pattern ? $sel = 'pattern_selected' : ($sel = '');
                    echo '<div class="pattern_overlay ' . $sel . '" id="' . $pattern . '" style="background: url(' . plugins_url('css/images/patterns/', dirname(__FILE__)) . $pattern . ') repeat top left transparent;"></div>';
                }
                ?>
  
</div>
	<small><?php 
                echo $theval['desc'];
                ?>
</small><div class="clearfix"></div>
</div>


<?php 
                break;
            case "section":
                $i++;
                ?>

<div class="sps_section">
<?php 
                $imgpth = plugins_url('images/trans.png', __FILE__);
                ?>
<div class="sps_title"><h3><img src="<?php 
                echo $imgpth;
                ?>
" class="inactive" alt="""><?php 
                echo $theval['name'];
                ?>
</h3><span class="submit"><input name="save<?php 
                echo $i;
                ?>
" type="submit" value="Save Changes" class="button button-primary" />
</span><div class="clearfix"></div></div>
<div class="sps_options">

<?php 
                break;
        }
    }
    ?>
 
<input type="hidden" name="action" value="save" />
<p><a target="_blank" href="https://ghozylab.com/plugins/ordernow.php?order=proplus&utm_source=lite&utm_medium=settingspage&utm_campaign=orderfromcp" class="tsc_buttons2 red">Upgrade to Pro Version  &nbsp;for only $<?php 
    echo EASYMEDIA_PRICE;
    ?>
</a> <span style="color:#666666;margin-left:2px; font-size:11px;">&nbsp; Need More Features? Upgrade to Pro Version!</span></p>
 </div> </div>
 </form>
 </div>
 
<p class="submit">
<a onClick="return false;" class="emgresetnow button-secondary" title="Reset Options" href="#">Reset Options</a>
<span style="color:#666666;margin-left:2px; font-size:11px;"> Use this button to restore these settings to default.</span></p>
 </div>



<?php 
}
Exemplo n.º 2
0
function spg_admin()
{
    global $emgplugname, $theshort, $theopt;
    $i = 0;
    $msgicon = plugins_url('images/confirm-check.png', __FILE__);
    if (isset($_REQUEST['saved'])) {
        echo '<script type="text/javascript">
    jQuery(function () {
    jQuery(".infoboxsaveorreset").show("slow");
    });
    </script>';
        $saveresmsg = 'Settings saved...';
    }
    if (isset($_REQUEST['reset'])) {
        echo '<script type="text/javascript">
    jQuery(function () {
    jQuery(".infoboxsaveorreset").show("slow");
    });
    </script>';
        $saveresmsg = 'Settings reset...';
    }
    ?>
<div id="spg_container">
    <div id="header">
      <div class="logo">
        <h2><?php 
    echo $emgplugname . "  (v " . easymedia_get_plugin_version() . ")";
    ?>
</h2>
      </div>
      <div class="icon-option"> </div>
      <div style="clear: both;"></div>
    </div>

<div id="main">
<div class="infoboxsaveorreset"><?php 
    echo $saveresmsg;
    ?>
</div>
<form method="post">
<div class="sps_wrap">
<div class="sps_opts">


<?php 
    settings_fields('easy_options_group');
    ?>

<?php 
    foreach ($theopt as $theval) {
        switch ($theval['type']) {
            case "open":
                ?>
	<?php 
                break;
            case "close":
                ?>
 
</div>
</div>
<br />

 
<?php 
                break;
            case 'text':
                ?>

<div class="sps_input sps_text">
	<label for="<?php 
                echo $theval['id'];
                ?>
"><?php 
                echo $theval['name'];
                ?>
</label>
 	<input name="<?php 
                echo $theval['id'];
                ?>
" id="<?php 
                echo $theval['id'];
                ?>
" type="<?php 
                echo $theval['type'];
                ?>
" value="<?php 
                if (easy_get_option($theval['id']) != "") {
                    echo stripslashes(easy_get_option($theval['id']));
                } else {
                    echo $theval['std'];
                }
                ?>
" />
 <small><?php 
                echo $theval['desc'];
                ?>
</small><div class="clearfix"></div>
 
 </div>
<?php 
                break;
            case 'margin':
                ?>

<div class="sps_input sps_text">
	<label for="<?php 
                echo $theval['id'];
                ?>
"><?php 
                echo $theval['name'];
                ?>
</label>
 	<input style="width:43px !important;" name="<?php 
                echo $theval['id'];
                ?>
" id="<?php 
                echo $theval['id'];
                ?>
" type="text" value="<?php 
                if (easy_get_option($theval['id']) != "") {
                    echo stripslashes(easy_get_option($theval['id']));
                } else {
                    echo $theval['std'];
                }
                ?>
" /> <?php 
                echo $theval['pixopr'];
                ?>
 <small><?php 
                echo $theval['desc'];
                ?>
</small><div class="clearfix"></div>
 
 </div>
<?php 
                break;
            case 'size':
                $default = $theval['std'];
                $sizeall = easy_get_option($theval['id']);
                if (!is_array($sizeall) || empty($sizeall)) {
                    $sizeall = $default;
                }
                ?>
	
<div class="sps_input sps_text">
	<label for="<?php 
                echo $theval['id'];
                ?>
"><?php 
                echo $theval['name'];
                ?>
</label>
   
 	<strong>Width</strong> <input style="margin-left:3px; width:43px !important;" name="<?php 
                echo $theval['id'];
                ?>
[width]" id="<?php 
                echo $theval['id'];
                ?>
[width]" type="text" value="<?php 
                if ($sizeall['width'] != "") {
                    echo stripslashes($sizeall['width']);
                } else {
                    echo $default;
                }
                ?>
" /> <?php 
                echo $theval['pixopr'];
                ?>
    
<span style="border-right:solid 1px #CCC; margin-right:11px; margin-left:9px;"></span>
 	<strong>Height</strong> <input style="margin-left:3px; width:43px !important;" name="<?php 
                echo $theval['id'];
                ?>
[height]" id="<?php 
                echo $theval['id'];
                ?>
[height]" type="text" value="<?php 
                if ($sizeall['height'] != "") {
                    echo stripslashes($sizeall['height']);
                } else {
                    echo $default;
                }
                ?>
" /> <?php 
                echo $theval['pixopr'];
                ?>

 <small><?php 
                echo $theval['desc'];
                ?>
</small><div class="clearfix"></div>
 
 </div>
<?php 
                break;
            case 'textarea':
                ?>

<div class="sps_input sps_textarea">
	<label for="<?php 
                echo $theval['id'];
                ?>
"><?php 
                echo $theval['name'];
                ?>
</label>
 	<textarea style="vertical-align:top !important;" name="<?php 
                echo $theval['id'];
                ?>
" type="<?php 
                echo $theval['type'];
                ?>
" cols="" rows=""><?php 
                if (easy_get_option($theval['id']) != "") {
                    echo stripslashes(easy_get_option($theval['id']));
                } else {
                    echo $theval['std'];
                }
                ?>
</textarea>
 <small><?php 
                echo $theval['desc'];
                ?>
</small><div class="clearfix"></div>
 
 </div>
  
<?php 
                break;
            case 'select':
                ?>

<div class="sps_input sps_select">
	<label for="<?php 
                echo $theval['id'];
                ?>
"><?php 
                echo $theval['name'];
                ?>
</label>
	
<select name="<?php 
                echo $theval['id'];
                ?>
" id="<?php 
                echo $theval['id'];
                ?>
">
<?php 
                foreach ($theval['options'] as $option) {
                    ?>
		<option <?php 
                    if (easy_get_option($theval['id']) == $option) {
                        echo 'selected="selected"';
                    }
                    ?>
><?php 
                    echo $option;
                    ?>
</option><?php 
                }
                ?>
</select>

	<small><?php 
                echo $theval['desc'];
                ?>
</small><div class="clearfix"></div>
</div>
<?php 
                break;
            case "checkbox":
                ?>

<div class="sps_input sps_checkbox">
	<label for="<?php 
                echo $theval['id'];
                ?>
"><?php 
                echo $theval['name'];
                ?>
</label>
<?php 
                easy_get_option($theval['id']) == 1 ? $checked = 'checked="checked"' : ($checked = '');
                ?>
<input name="<?php 
                echo $theval['id'];
                ?>
" id="<?php 
                echo $theval['id'];
                ?>
" class="switch" type="checkbox" <?php 
                echo $checked;
                ?>
 value="1"></input>
	<small><?php 
                echo $theval['desc'];
                ?>
</small><div class="clearfix"></div>
 
 </div>

<?php 
                break;
            case 'slider':
                ?>

<div class="sps_input">
	<label for="<?php 
                echo $theval['id'];
                ?>
"><?php 
                echo $theval['name'];
                ?>
</label>
	
    <div id="<?php 
                echo $theval['id'];
                ?>
_slider" ></div><input style="margin-left:10px; width:43px !important;" name="<?php 
                echo $theval['id'];
                ?>
" id="<?php 
                echo $theval['id'];
                ?>
" type="text" value="<?php 
                if (easy_get_option($theval['id']) != "") {
                    echo stripslashes(easy_get_option($theval['id']));
                } else {
                    echo $theval['std'];
                }
                ?>
" /> <?php 
                echo $theval['pixopr'];
                ?>

	<small><?php 
                echo $theval['desc'];
                ?>
</small><div class="clearfix"></div>
</div>
<?php 
                break;
            case "color":
                ?>

<div class="sps_input sps_text">
<label for="<?php 
                echo $theval['id'];
                ?>
"><?php 
                echo $theval['name'];
                ?>
</label>

<div id="<?php 
                echo $theval['id'];
                ?>
_picker" class="colorSelector"><div></div></div>
<input style="margin-left:3px; width:75px !important;" name="<?php 
                echo $theval['id'];
                ?>
" id="<?php 
                echo $theval['id'];
                ?>
" type="text" value="<?php 
                if (easy_get_option($theval['id']) != "") {
                    echo stripslashes(easy_get_option($theval['id']));
                } else {
                    echo $theval['std'];
                }
                ?>
" />
<small><?php 
                echo $theval['desc'];
                ?>
</small>
<div class="clearfix"></div>
</div>


<?php 
                break;
            case 'pattern':
                ?>

<div class="sps_input">
	<label style="vertical-align:top !important;" for="<?php 
                echo $theval['id'];
                ?>
"><?php 
                echo $theval['name'];
                ?>
</label>
    <input type="hidden" value="<?php 
                if (easy_get_option($theval['id']) != "") {
                    echo stripslashes(easy_get_option($theval['id']));
                } else {
                    echo $theval['std'];
                }
                ?>
" name="<?php 
                echo $theval['id'];
                ?>
" id="<?php 
                echo $theval['id'];
                ?>
" />
    
    <div class="pattern_box">
    
                	<div style="float: left;" class="pattern_overlay <?php 
                if (!easy_get_option($theval['id']) || easy_get_option($theval['id']) == 'none') {
                    echo 'pattern_selected';
                }
                ?>
" id="no_pattern"> no pattern </div>
    
                <?php 
                foreach (easmedia_patterns_ls() as $pattern) {
                    easy_get_option($theval['id']) == $pattern ? $sel = 'pattern_selected' : ($sel = '');
                    echo '<div class="pattern_overlay ' . $sel . '" id="' . $pattern . '" style="background: url(' . plugins_url('css/images/patterns/', dirname(__FILE__)) . $pattern . ') repeat top left transparent;"></div>';
                }
                ?>
  
</div>
	<small><?php 
                echo $theval['desc'];
                ?>
</small><div class="clearfix"></div>
</div>


<?php 
                break;
            case "section":
                $i++;
                ?>

<div class="sps_section">
<?php 
                $imgpth = plugins_url('images/trans.png', __FILE__);
                ?>
<div class="sps_title"><h3><img src="<?php 
                echo $imgpth;
                ?>
" class="inactive" alt="""><?php 
                echo $theval['name'];
                ?>
</h3><span class="submit"><input name="save<?php 
                echo $i;
                ?>
" type="submit" value="Save Changes" class="button button-primary" />
</span><div class="clearfix"></div></div>
<div class="sps_options">

<?php 
                break;
        }
    }
    ?>
 
<input type="hidden" name="action" value="save" />
 </div> </div>
 </form>
 </div>
 
<form method="post">
<p class="submit">
<input class="button button-secondary" name="reset" type="submit" value="Reset Options" onclick="return confirm('Are you sure? This will restore these settings to default.');"/>
<input type="hidden" name="action" value="reset" />
<span style="color:#666666;margin-left:2px; font-size:11px;"> Use this button to restore these settings to default.</span></p>
</form>
 
 </div>



<?php 
}