Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- defined('is_running') or die('Not an entry point...');
- class Sample_Theme_Admin_Plugin {
- var $configFile;
- var $config = array();
- function Sample_Theme_Admin_Plugin() {
- $this->init();
- $cmd = common::GetCommand();
- if (common::LoggedIn()) {
- switch($cmd) {
- case 'save_config':
- $this->checkSave();
- break;
- }
- }
- $this->configForm();
- }
- function init() {
- global $addonPathData;
- $this->configFile = $addonPathData.'/index.php';
- $this->getData();
- }
- function getData() {
- global $langmessage;
- if (file_exists($this->configFile)) {
- require($this->configFile);
- $this->config = $myThemeConfig;
- }
- else {
- $this->config = array(
- 'img_1'=>'img1.jpg',
- 'title_1'=>'<span class="ftitle"><span class="color2">We Have</span><span class="color1">Propositions</span><span>For Everybody</span></span><p>Lorem ipsum dolor sit amet, consectetur adipisicing elit sed do eiusmod tempor.</p>
- <a href="#" class="button1">Read More</a>',
- 'img_2'=>'img2.jpg',
- 'title_2'=>'<span class="ftitle"><span class="color2">Fresh Ideas</span><span class="color1">For Growing</span><span>Your Business</span></span><p>Lorem ipsum dolor sit amet, consectetur adipisicing elit sed do eiusmod tempor.</p><a href="#" class="button1">Read More</a>',
- 'img_3'=>'img3.jpg',
- 'title_3'=>'<span class="ftitle"><span class="color2">The Best</span><span class="color1">You Can Find</span><span>On The Web</span></span><p>Lorem ipsum dolor sit amet, consectetur adipisicing elit sed do eiusmod tempor.</p><a href="#" class="button1">Read More</a>',
- 'logo'=>'logo.png',
- 'Facebook'=>'http://facebook.com/your_id',
- 'Twitter'=>'http://twitter.com/your_id',
- 'Picasa'=>'http://picasa.com/your_id',
- 'YouTube'=>'http://youTube.com/your_id',
- 'favicon'=>'http://link_to_favicon.com/folder_favicon,ico',
- 'phone_no'=>'<span class="color1">+1 800</span> 123 45 67',
- 'copyrights'=>'Superior.com © 2012',
- 'front_side_menu'=>'<h3>Publications</h3>
- <ul class="list2">
- <li><a href="#">PR Management</a><br>
- Dalesuad asorbi nunra vida- sea atcurs usecuctu.</li>
- <li><a href="#">Global solutions</a><br>Naser maellus pore qus ese- dasese dusce.</li>
- <li><a href="#">Progressive Research</a><br>Atcurs usuctu aecenas ttique maellrase qus esedasese.</li>
- <li><a href="#">New Technologies</a><br>Merts maellrase qus esedias dusceer lrurtasfeugiat.</li>
- </ul>',
- 'front_extra_menu_1'=>'<h2>Consulting</h2>
- <p>Superior.com is one of
- <a href="http://blog.templatemonster.com/free-website-templates/" target="_blank">
- free website templates</a>
- created by TemplateMonster.com. It is also XHTML & CSS valid.</p>',
- 'front_extra_menu_2'=>'<h2>Analysis</h2>
- <p>This website template has sev-eral pages:
- <a href="index.html">Home</a>,
- <a href="Company.html">Company</a>,
- <a href="Solutions.html">Solutions</a>,
- <a href="Services.html">Services</a>,
- <a href="Contacts.html">Contact Us</a>
- (contact form – doesn’t work).</p>',
- 'front_extra_menu_3'=>'<h2>Strategy</h2>
- <p>This <a href="http://blog.templatemonster.com/2011/11/14/free-website-template-jquery-slider-business-project/" target="_blank">Superior Template</a> goes with two packages. PSD source files are available for the registered members.</p>',
- 'front_extra_menu_4'=>'<h2>Services</h2>
- <ul class="list1">
- <li><a href="#">Sed ut perspiciatis unde </a></li>
- <li><a href="#">Omnis iste natus errorsitvo</a></li>
- <li><a href="#">Uptatem acusantium domque </a></li>
- <li><a href="#">Laudantium totam rem</a></li>
- </ul>',
- 'pages_side_menu'=>'<h2>Why Choose Us</h2>
- <div class="wrapper">
- <span class="dropcap_1">1</span>
- <p class="pad_bot1"><span class="color1">Quis auteure reprehenderit</span><br>
- Dalesuad asorbi nunra vidasea atcurs usecuctu.</p>
- </div>
- <div class="wrapper">
- <span class="dropcap_1">2</span>
- <p class="pad_bot1"><span class="color1">Neque porro quisquam estorem</span><br>
- Naser maellus pore qus esedase- se dusce.</p>
- </div>
- <div class="wrapper">
- <span class="dropcap_1">3</span>
- <p class="pad_bot1"><span class="color1">Nemo enim voluptatem</span><br>
- Atcurs usuctu aecenas ttique maellrase qus esedasese.</p>
- </div>
- <div class="wrapper">
- <span class="dropcap_1">4</span>
- <p class="pad_bot1"><span class="color1">Sed ut perspiciatis unde omnis</span><br>
- Merts maellrase qus esedias dusceer lrurtasfeugiat.</p>
- </div>
- </div>
- </div>',
- // 'grayscale_enable'=>'enable'
- );
- if (!$this->saveConfig()) {
- message($langmessage['OOPS']);
- }
- else {
- message($langmessage['SAVED']);
- }
- }
- }
- function checkSave() {
- global $langmessage;
- $this->config['slid_img']['img_1'] = ($_POST['img_1']);
- $this->config['slid_img']['img_2'] = ($_POST['img_2']);
- $this->config['slid_img']['img_3'] = ($_POST['img_3']);
- $this->config['slid_img']['img_4'] = ($_POST['img_4']);
- $this->config['slid_img']['img_5'] = ($_POST['img_5']);
- $this->config['slid_img']['img_6'] = ($_POST['img_6']);
- $this->config['slid_img']['img_7'] = ($_POST['img_7']);
- $this->config['slid_img']['img_8'] = ($_POST['img_8']);
- $this->config['slid_img']['img_9'] = ($_POST['img_9']);
- $this->config['slid_img']['img_10'] = ($_POST['img_10']);
- $this->config['slid_til']['title_1'] = ($_POST['title_1']);
- $this->config['slid_til']['title_2'] = ($_POST['title_2']);
- $this->config['slid_til']['title_3'] = ($_POST['title_3']);
- $this->config['slid_til']['title_4'] = ($_POST['title_4']);
- $this->config['slid_til']['title_5'] = ($_POST['title_5']);
- $this->config['slid_til']['title_6'] = ($_POST['title_6']);
- $this->config['slid_til']['title_7'] = ($_POST['title_7']);
- $this->config['slid_til']['title_8'] = ($_POST['title_8']);
- $this->config['slid_til']['title_9'] = ($_POST['title_9']);
- $this->config['slid_til']['title_10'] = ($_POST['title_10']);
- $this->config['copyrights'] = ($_POST['copyrights']);
- /* $fields = $_POST ['another_image'];
- $values = $_POST ['another_title'];
- foreach ( $values as $key => $value)
- {
- if ( $fields[$key]=='') continue;
- $this->config[$key] = $fields;
- }
- */
- /*
- $img ='img_';
- for ($i=0, $keyCount = count($keys); $i < $keyCount; $i++) {
- $this->config[$img[$i]] = ($_POST['another_image']); continue;
- }
- $len = count($_POST['another_image']);
- for ($i=0; $i < $len; $i++)
- $this->config[$len[$key]] = $key;
- */
- /* for ($i=0, $keyCount = count($keys); $i < $keyCount; $i++) {
- $combinedArray[$keys[$i]] = $values[$i];
- }
- */
- // $this->config['another_image'] = ($_POST['another_image']); continue;
- /*
- $fields = $_POST ['another_image'];
- $values = $_POST ['another_title'];
- if ( $fields[$key]=='') continue;
- $this->config[$fields[$key]] = $fields[$key].$i;
- */
- /* $fields = $_POST ['another_image'];
- $values = $_POST ['another_title'];
- foreach ( $values as $key => $value)
- {
- if ( $fields[$key]=='' || $value == '') continue;
- $this->config[$fields[$key]] = $value;
- }
- */
- /*if (isset($_POST['grayscale_enable'])) {
- $this->config['grayscale_enable'] = $_POST['grayscale_enable'];
- } else {
- $this->config['grayscale_enable'] = '';
- }*/
- if (!$this->saveConfig()) {
- message($langmessage['OOPS']);
- } else {
- message($langmessage['SAVED']);
- }
- }
- function saveConfig() {
- return gpFiles::SaveArray($this->configFile, 'myThemeConfig', $this->config);
- }
- function configForm() {
- global $langmessage,$gpLayouts,$dataDir,$config, $page;
- if($page->theme_is_addon ){
- $Theme_path = '/data/_themes/';
- } else {
- $Theme_path = '/themes/';
- }
- $web_Path = common::GetDir();
- $this_theme_folder = $web_Path.$Theme_path.str_replace('&','&',$page->theme_name);
- $array =& $this->config;
- ?>
- <h2 class="nocufon"><?php echo $config['title']; ?> Theme Configurations</h2>
- <form method="post" action="<?php echo common::getUrl('Admin_Sample_Theme_Admin_Plugin') ?>">
- <div class="collapsible">
- <h4 class="head one"><a name="collapsible" href="#">Front Page Slider</a></h4>
- <div class="collapsearea">
- <table id="anotherfa" cellpadding="4" class="bordered configuration collapsible">
- <?php
- /* $values = $_POST ['another_title'];
- foreach ( $values as $key => $value)
- {
- if ( $fields[$key]=='' || $value == '') continue;
- $this->config[$fields[$key]] = $value;
- }
- *//* $silder_image = new ArrayIterator($slim);
- $silder_title = new ArrayIterator($slit);
- // Use a MultipleIterator to iterate over our two arrays at the same time!
- $mit = new MultipleIterator(MultipleIterator::MIT_KEYS_ASSOC);
- $mit->attachIterator($silder_image, 'image');
- $mit->attachIterator($silder_title, 'title');
- $fields = $_POST ['another_image'];
- *///if (!$slim) $slit = array();
- // foreach ( $slim as $key => $slit )continue;
- // $i = 0;
- // {
- // if ( $key == 'facebook' || $key == 'twitter' || $key == 'in' ) continue;
- //foreach ($mit as $it)
- //echo $key. '-'. $slit;}
- $slid_img = array_filter($array['slid_img']);
- $slid_til = array_filter($array['slid_til']);
- $val_img = array_values($slid_img);
- $key_img = key($slid_img);
- $val_til = array_values($slid_til);
- $key_til = key($slid_til);
- $numtocount = count( $slid_img );
- //foreach ($slid_img as $key1 => $value1) {
- // foreach ($slid_til as $key2 => $value2)
- //$aMerged = array_combine($fields, $values);
- //for ($i = 0; $i < 10; $i++) {
- // var_dump(key($slid_img));
- // next($slid_img);
- // print_r($key_img);
- // echo array_values($array['slid_img']);
- //}
- //$count = 0;
- /* foreach ($slid_img as $key=>$value) {
- ++$count;
- if ($count == 1) {
- echo "<li>";
- echo "<div>" . $value."</div>";
- } else {
- echo "<div>" . $value."</div>";
- echo "</li>";
- $count = 0;
- }
- }
- *//// if (!$meta) $meta = array();
- // foreach ( $slid_img as $key => $value );
- // {
- // echo $key1 ."=". $value1;
- //if ( $slid_til = $valueeas ) continue; ?>
- <tbody id="copyf">
- <tr>
- <td style="white-space:nowrap">Slider Image <?php $key1;?></td>
- <td><div><input type="text" value="<?php echo $key1;?>" size="40" name="<?php echo $value1;?>"></div>Maximum pixels for displayed images is width: 960px height: 453px.</td></tr>
- <tr>
- <td style="white-space:nowrap; border-top:none;">Slider Title <?php echo $key2;?></td><td><div><textarea rows="3" cols="50" name="<?php echo $key2;?>"><?php echo $value2;?></textarea></div></td></tr></tbody>
- <?php //}}
- /* foreach ($aMerged as $key => $value)
- {
- echo $GLOBALS[$key] = strtoupper ($value);
- }
- //for ( $i = 0; $i < count($fields); $i++)
- echo var_export($aMerged);
- */ //echo '<a href=" ' . $values[$i] . ' "> ' . $fields[$i] . '</a>';
- //foreach ($slid_img as $key => $value): {?>
- <?php /* <tbody id="copyf">
- <tr>
- <td style="white-space:nowrap">Slider Image <?php //echo $i++;?></td>
- <td><div><input type="text" value="<?php echo $value;?>" size="40" name="<?php echo $value;?>"></div>Maximum pixels for displayed images is width: 960px height: 453px.</td></tr>
- <tr>
- <td style="white-space:nowrap; border-top:none;">Slider Title <?php echo $key;?>"</td><td><div><textarea rows="3" cols="50" name="<?php echo $key;?>"><?php echo $value;?></textarea></div></td></tr></tbody>
- */?>
- <?php //} endforeach;?>
- </table>
- <div id="addmorelink" style="margin-top:15px; margin-bottom:15px; ">
- <a href='javascript:addField()'><img class="theme_fuse_add_meta" src=" <?php echo $this_theme_folder; ?>/color/images/add_icon.png"> Add more</a> | <a href='javascript:remField()'><img class="theme_fuse_add_meta" src=" <?php echo $this_theme_folder; ?>/color/images/remove_icon.png"> Remove</a>
- </div>
- </div>
- </div>
- <div>
- <input type="hidden" value="save_config" name="cmd">
- <input type="submit" class="gppost gpsubmit" value="<?php echo $langmessage['save'] ?>">
- <input type="button" value="<?php echo $langmessage['cancel'] ?>" name="" onclick="confirmation()" class="gpsubmit">
- <a class="gpsubmit gppost" href="./" target="_blank">Preview</a>
- </div>
- <!--<p class="admin_note"><b>See: </b><?php /*?><a title="Preferences" name="admin_box" href="/dstheme.bugs3.com/gp2/index.php/Admin_Preferences">Preferences</a><?php */?>
- <a href="<?php //echo $this_theme_folder;?>/help.php" onclick="centeredPopup(this.href,'myWindow','800','500','yes');return false">Help ?</a>
- </p>
- -->
- </form>
- <div class="donasimu" style="padding-top:10px;">
- <a id="displayText" href="javascript:toggle();">Click Here to Donate</a>
- <div id="toggleText" style="display: none;">
- <div class="donate" id="donate"><p>If you find this themes useful to you, please consider making a small dontations. Your contribution is needed for making this theme and pluggin better. If you are not able to donate, that is OK. Thanks for your kind support!<br />
- Currently i dont have a paypal account so you can donate via ekopratono@yahoo.com</p>
- <form target="_blank" action="https://www.paypal.com/cgi-bin/webscr" method="post">
- <fieldset style="border: 2px solid #F8CDA1; background-color: #ffffee;">
- <input type="hidden" name="cmd" value="_donations">
- <input type="hidden" name="business" value="ekopratono@yahoo.com">
- <input type="hidden" name="lc" value="ID">
- <input type="hidden" name="item_name" value="David Saerang">
- <input type="hidden" name="item_number" value="Donation to keep David create gp|Easy Themes">
- <input type="hidden" name="currency_code" value="USD">
- <input type="hidden" name="return" value="http://dstheme.bugs3.com/">
- <label for="amount" style="font-family: Georgia; color: #000000; margin-right: 1em;"><strong>Amount:</strong></label>
- <input type="text" id="amount" style="margin: 0;" name="amount" size="5" value="3"><strong style="margin-left: 0.25em;"> USD</strong>
- <input type="hidden" name="bn" value="PP-DonationsBF:btn_donate_SM.gif:NonHostedGuest">
- <input type="image" style="float: right; margin: 0;" alt="Make payments with PayPal - it's fast, free and secure!" name="submit" src="https://www.paypalobjects.com/en_US/i/btn/btn_donate_SM.gif" ></fieldset></form>
- </div>
- </div>
- </div>
- <?php
- /* foreach ($array['slider'] as $a) {
- $count_values[$a]++;
- }
- *//* function countValuesRecursive($array, $count = 0) {
- global $myThemeConfig;
- //$array = $array['slider'];
- // Cycle through the array
- foreach ($array['slider'] as $value) {
- // Check if the value is an array
- if (is_array($value)) {
- // Cycle through deeper level
- $count = countValuesRecursive($value, $count);
- }
- else {
- // Check if the value is TRUE
- if ($value) {
- $count++;
- }
- }
- }
- // Return the count
- return $count + 2;
- }
- */?>
- <script type="text/javascript">
- window.onload=addField;
- var i = "<?php echo $numtocount + 1; ?>";
- function addField(){
- var newContent = '<tbody id="copyf"><tr><td style="white-space:nowrap">Slider Image '+ i +'</td><td><div><input type="text" value="" size="40" name="img_'+ i +'"></div>Maximum pixels for displayed images is width: 960px height: 453px.</td></tr><tr><td style="white-space:nowrap">Slider Title '+ i +'</td><td><div><textarea rows="3" cols="50" name="title_'+ i +'"></textarea></div></td></tr></tbody>';
- $("#anotherfa").append(newContent);
- i++;
- return false;
- }
- function remField(){
- if( i > 2 ) {
- $('tbody:last').remove();
- i--;
- }
- return false;
- }
- </script>
- <script type="text/javascript">// <![CDATA[
- function confirmation() {
- var answer = confirm("Are you sure you want to close")
- if (answer){
- hidestuff();
- } else {
- }
- }
- function hidestuff(){
- document.getElementById("admincontainer").style.visibility="hidden";
- }
- function toggle() {
- var ele = document.getElementById("toggleText");
- var text = document.getElementById("displayText");
- if(ele.style.display == "block") {
- ele.style.display = "none";
- text.innerHTML = "Click Here to Donate";
- } else {
- ele.style.display = "block";
- text.innerHTML = "Not Now";
- }
- }
- var popupWindow = null;
- function centeredPopup(url,winName,w,h,scroll){
- LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
- TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
- settings ='height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable'
- popupWindow = window.open(url,winName,settings)
- }
- // ]]></script>
- <?php }
- }
- require_once ( 'theme_functions.php' );
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement