Advertisement
Guest User

Untitled

a guest
May 18th, 2016
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.65 KB | None | 0 0
  1. <?php
  2. /**
  3. * A unique identifier is defined to store the options in the database and reference them from the theme.
  4. * By default it uses the theme name, in lowercase and without spaces, but this can be changed if needed.
  5. * If the identifier changes, it'll appear as if the options have been reset.
  6. *
  7. */
  8. function optionsframework_option_name() {
  9.  
  10. // This gets the theme name from the stylesheet (lowercase and without spaces)
  11. $themename = get_option( 'stylesheet' );
  12. $themename = preg_replace("/\W/", "_", strtolower($themename) );
  13.  
  14. $optionsframework_settings = get_option(ONETONE_OPTIONS_PREFIXED.'optionsframework');
  15. $optionsframework_settings['id'] = $themename;
  16. update_option(ONETONE_OPTIONS_PREFIXED.'optionsframework', $optionsframework_settings);
  17.  
  18. // echo $themename;
  19. }
  20.  
  21. /**
  22. * Defines an array of options that will be used to generate the settings page and be saved in the database.
  23. * When creating the 'id' fields, make sure to use all lowercase and no spaces.
  24. *
  25. */
  26.  
  27. function optionsframework_options() {
  28.  
  29. // Background Defaults
  30.  
  31. $page_background = array(
  32. 'color' => '',
  33. 'image' => ONETONE_THEME_BASE_URL.'/images/leftbg.jpg',
  34. 'repeat' => 'no-repeat',
  35. 'position' => 'top left',
  36. 'attachment'=>'fixed' );
  37.  
  38.  
  39. $section_title = array("","About Us","Services","Gallery","Contact","Custom Section");
  40. $section_menu = array("Home","About Us","Services","Gallery","Contact","Custom Section");
  41. $section_background = array(
  42. array(
  43. 'color' => '',
  44. 'image' => ONETONE_THEME_BASE_URL.'/images/home-bg01.jpg',
  45. 'repeat' => 'repeat',
  46. 'position' => 'top left',
  47. 'attachment'=>'scroll' ),
  48. array(
  49. 'color' => '',
  50. 'image' => ONETONE_THEME_BASE_URL.'/images/home-bg02.jpg',
  51. 'repeat' => 'repeat',
  52. 'position' => 'top left',
  53. 'attachment'=>'scroll' ),
  54. array(
  55. 'color' => '',
  56. 'image' => ONETONE_THEME_BASE_URL.'/images/home-bg03.jpg',
  57. 'repeat' => 'repeat',
  58. 'position' => 'top left',
  59. 'attachment'=>'scroll' ),
  60. array(
  61. 'color' => '',
  62. 'image' => ONETONE_THEME_BASE_URL.'/images/home-bg02.jpg',
  63. 'repeat' => 'repeat',
  64. 'position' => 'top left',
  65. 'attachment'=>'scroll' ),
  66. array(
  67. 'color' => '',
  68. 'image' => ONETONE_THEME_BASE_URL.'/images/home-bg03.jpg',
  69. 'repeat' => 'repeat',
  70. 'position' => 'top left',
  71. 'attachment'=>'scroll' ),
  72. array(
  73. 'color' => '',
  74. 'image' => ONETONE_THEME_BASE_URL.'/images/home-bg02.jpg',
  75. 'repeat' => 'repeat',
  76. 'position' => 'top left',
  77. 'attachment'=>'scroll' )
  78. );
  79. $section_css_class = array("section-banner","section-about","","","","");
  80.  
  81. $section_content = array('<div class="banner-box">
  82. <h1>TARAY BOGRILOYAT srians</h1>
  83. <p>CRAS URNA LEO, FRINGILLA NEC ALIQUAM AC, VARIUS IN ENIM. MAECENAS NON FELIS AUGUE,
  84. QUIS SAGITTIS JUSTO. DONEC GRAVIDA, ARCU IN ALIQUET CONVALLIS</p>
  85. <div class="banner-scroll"><a href="#about-us" class="scroll" data-section="about-us"><img src="'.ONETONE_THEME_BASE_URL.'/images/down.png" alt=""></a></div>
  86. <ul class="banner-sns">
  87. <li><a href="#"><img src="'.ONETONE_THEME_BASE_URL.'/images/facebook.png" alt=""></a></li>
  88. <li><a href="#"><img src="'.ONETONE_THEME_BASE_URL.'/images/skype.png" alt=""></a></li>
  89. <li><a href="#"><img src="'.ONETONE_THEME_BASE_URL.'/images/title.png" alt=""></a></li>
  90. <li><a href="#"><img src="'.ONETONE_THEME_BASE_URL.'/images/linkedin.png" alt=""></a></li>
  91. <li><a href="#"><img src="'.ONETONE_THEME_BASE_URL.'/images/google.png" alt=""></a></li>
  92. <li><a href="#"><img src="'.ONETONE_THEME_BASE_URL.'/images/rss.png" alt=""></a></li>
  93. </ul>
  94. </div>',
  95. '<div class="two_third">
  96. <h3>Biography</h3>
  97. <p>Morbi rutrum, elit ac fermentum egestas, tortor ante vestibulum est, eget
  98. scelerisque nisl velit eget tellus. Fusce porta facilisis luctus. Integer neque
  99. dolor, rhoncus nec euismod eget, pharetra et tortor. Nulla id pulvinar nunc.
  100. Vestibulum auctor nisl vel lectus ullamcorper sed pellentesque dolor
  101. eleifend. Praesent lobortis magna vel diam mattis sagittis.Mauris porta odio
  102. eu risus scelerisque id facilisis ipsum dictum vitae volutpat. Lorem ipsum
  103. dolor sit amet, consectetur adipiscing elit. Sed pulvinar neque eu purus
  104. sollicitudin et sollicitudin dui ultricies. Maecenas cursus auctor tellus sit
  105. amet blandit. Maecenas a erat ac nibh molestie interdum. Class aptent
  106. taciti sociosqu ad litora torquent per conubia nostra, per inceptos
  107. himenaeos. Sed lorem enim, ultricies sed sodales id, convallis molestie
  108. ipsum. Morbi eget dolor ligula. Vivamus accumsan rutrum nisi nec
  109. elementum. Pellentesque at nunc risus. Phasellus ullamcorper
  110. bibendum varius. Quisque quis ligula sit amet felis ornare porta. Aenean
  111. viverra lacus et mi elementum mollis. Praesent eu justo elit.</p>
  112. </div>
  113. <div class="one_third last">
  114. <h3>Personal Info</h3>
  115. <ul>
  116. <li class="info-phone">+1123 2456 689</li>
  117. <li class="info-address">3301 Lorem Ipsum, Dolor Sit St</li>
  118. <li class="info-email"><a href="#">support@mageewp.com. </a></li>
  119. <li class="info-website"><a href="#">Mageewp.com</a></li>
  120. </ul>
  121. </div>',
  122. '<div class="one_third">
  123. <img src="'.ONETONE_THEME_BASE_URL.'/images/services-icon.png" alt="">
  124. <h3>Service 1</h3>
  125. <p>Donec in vehicula augue. Sed et
  126. nisi sem, at semper dolor.
  127. Pellentesque habitant morbi
  128. tristique senectus et netu..</p>
  129. </div>
  130. <div class="one_third">
  131. <img src="'.ONETONE_THEME_BASE_URL.'/images/services-icon-2.png" alt="">
  132. <h3>Service 2</h3>
  133. <p>Donec in vehicula augue. Sed et
  134. nisi sem, at semper dolor.
  135. Pellentesque habitant morbi
  136. tristique senectus et netu..</p>
  137. </div>
  138. <div class="one_third last">
  139. <img src="'.ONETONE_THEME_BASE_URL.'/images/services-icon-3.png" alt="">
  140. <h3>Service 3</h3>
  141. <p>Donec in vehicula augue. Sed et
  142. nisi sem, at semper dolor.
  143. Pellentesque habitant morbi
  144. tristique senectus et netu..</p>
  145. </div>',
  146. '<div class="portfolio-list">
  147. <ul>
  148. <li><a href="#"><img class="port-img" src="'.ONETONE_THEME_BASE_URL.'/images/g1.jpg"></a></li>
  149. <li><a href="#"><img class="port-img" src="'.ONETONE_THEME_BASE_URL.'/images/g2.jpg"></a></li>
  150. <li><a href="#"><img class="port-img" src="'.ONETONE_THEME_BASE_URL.'/images/g3.jpg"></a></li>
  151. <li><a href="#"><img class="port-img" src="'.ONETONE_THEME_BASE_URL.'/images/g4.jpg"></a></li>
  152. <li><a href="#"><img class="port-img" src="'.ONETONE_THEME_BASE_URL.'/images/g5.jpg"></a></li>
  153. <li><a href="#"><img class="port-img" src="'.ONETONE_THEME_BASE_URL.'/images/g6.jpg"></a></li>
  154. <li><a href="#"><img class="port-img" src="'.ONETONE_THEME_BASE_URL.'/images/g7.jpg"></a></li>
  155. <li><a href="#"><img class="port-img" src="'.ONETONE_THEME_BASE_URL.'/images/g8.jpg"></a></li>
  156. </ul>
  157. </div>',
  158. '<p class="contact-text">INTEGER ALIQUET ARCU SIT AMET SEM PORTA FACILISIS. CURABITUR SAPIEN SAPIEN,
  159. BLANDIT IN MOLESTIE ET, SAGITTIS ID LOREM. NULLA MALESUADA MAURIS ID TURPIS</p>
  160. <div class="contact-area">
  161. <form class="contact-form" method="post" action="">
  162. <input type="text" name="name" id="name" value="" placeholder="Name" size="22" tabindex="1" aria-required="true">
  163. <input type="text" name="email" id="email" value="" placeholder="Email" size="22" tabindex="2" aria-required="true">
  164. <textarea name="message" id="message" cols="39" rows="7" tabindex="4" placeholder="Message"></textarea>
  165. <p class="noticefailed"></p>
  166. <input type="hidden" name="sendto" id="sendto" value="YOUR EMAIL HERE(Default Admin Email)">
  167. <input type="button" name="submit" id="submit" value="Post">
  168. </form>
  169. </div>
  170. ',
  171. '<p>Donec in vehicula augue. Sed et nisi sem, at semper dolor. Pellentesque habitant morbi tristique
  172. senectus et netus et malesuada fames ac turpis egestas. Mauris ut urna nibh, a semper
  173. neque. Mauris ultrices tempus nisi, et porttitor nulla varius a. Ut turpis magna,
  174. feugiat quis ultrices tristique, rhoncus eu leo. In eu quam lacus. Praesent
  175. Vehicula augue. Sed et nisi sem, at semper dolor. Pellentesque habitant morbi tristique
  176. senectus et netus et malesuada fames ac turpis egestas. Mauris ut urna nibh, a semper
  177. anews sed ovref neque. Mauris ultrices tempus nisi, et porttitor nulla varius a. Ut turpis magna,
  178. feugiat quis ultrices tristique, rhoncus eu leo. In eu quam lacus. dear Praesent Donec in vehicula augue. Sed et nisi sem, at semper dolor. Pellentesque habitant morbi tristique
  179. senectus et netus et malesuada fames ac turpis egestas. Mauris ut urna nibh, a semper
  180. neque. Mauris ultrices tempus nisi, et porttitor nulla varius a. Ut turpis magna,
  181. feugiat quis ultrices tristique, rhoncus eu leo. In eu quam lacus. Praesent
  182. Vehicula augue. Sed et nisi sem, at semper dolor. Pellentesque habitant morbi tristique
  183. senectus et netus et malesuada fames ac turpis egestas. Mauris ut urna nibh, a semper
  184. anews sed ovref neque. Mauris ultrices tempus nisi, et porttitor nulla varius a. Ut turpis magna,
  185. feugiat quis ultrices tristique, rhoncus eu leo. In eu quam lacus. dear Praesent</p>'
  186. );
  187.  
  188. $options = array();
  189. // HEADER
  190. $options[] = array(
  191. 'name' => __('General Options', 'onetone'),
  192. 'type' => 'heading');
  193.  
  194. $options[] = array(
  195. 'name' => __('Upload Logo', 'onetone'),
  196. 'id' => 'logo',
  197. 'std' => ONETONE_THEME_BASE_URL.'/images/logo.png',
  198. 'type' => 'upload');
  199.  
  200. $options[] = array(
  201. 'name' => __('Favicon', 'onetone'),
  202. 'desc' => __('An icon associated with a URL that is variously displayed, as in a browser\'s address bar or next to the site name in a bookmark list. Learn more about <a href="'.esc_url("http://en.wikipedia.org/wiki/Favicon").'" target="_blank">Favicon</a>', 'onetone'),
  203. 'id' => 'favicon',
  204. 'type' => 'upload');
  205.  
  206. $options[] = array(
  207. 'name' => __('Post & Page Background', 'onetone'),
  208. 'id' => 'page_background',
  209. 'std' => $page_background,
  210. 'type' => 'background' );
  211.  
  212. $options[] = array(
  213. 'name' => __('Custom CSS', 'onetone'),
  214. 'desc' => __('The following css code will add to the header before the closing &lt;/head&gt; tag.', 'onetone'),
  215. 'id' => 'custom_css',
  216. 'std' => 'body{margin:0px;}',
  217. 'type' => 'textarea');
  218.  
  219. ////HOME PAGE
  220. $options[] = array(
  221. 'name' => __('Home Page', 'onetone'),
  222. 'type' => 'heading');
  223.  
  224. //HOME PAGE SECTION
  225.  
  226.  
  227.  
  228. $options[] = array(
  229. 'name' => __('Section Num', 'onetone'),
  230. 'desc' => __('The number of home page sections.', 'onetone'),
  231. 'id' => 'section_num',
  232. 'std' => '6',
  233. 'type' => 'text');
  234.  
  235. $default_section_num = count($section_menu);
  236. $section_num = onetone_options_array('section_num');
  237.  
  238. if(isset($section_num) && is_numeric($section_num) && $section_num>0){
  239. $section_num = $section_num;
  240. }
  241. else{
  242. $section_num = $default_section_num;
  243. }
  244.  
  245. for($i=0; $i < $section_num; $i++){
  246.  
  247. if(!isset($section_title[$i])){$section_title[$i] = "";}
  248. if(!isset($section_menu[$i])){$section_menu[$i] = "";}
  249. if(!isset($section_background[$i])){$section_background[$i] = array('color' => '',
  250. 'image' => '',
  251. 'repeat' => '',
  252. 'position' => '',
  253. 'attachment'=>'');}
  254. if(!isset($section_css_class[$i])){$section_css_class[$i] = "";}
  255. if(!isset($section_content[$i])){$section_content[$i] = "";}
  256.  
  257. $options[] = array('name' => sprintf(__('Section %s', 'onetone'),($i+1)),'id' => 'slide_group_start_'.$i.'','type' => 'start_group','class'=>'group_close');
  258. $options[] = array('name' => __('Section Title', 'onetone'),'id' => 'section_title_'.$i.'','type' => 'text','std'=>$section_title[$i]);
  259. $options[] = array('name' => __('Menu Title', 'onetone'),'id' => 'menu_title_'.$i.'','type' => 'text','std'=>$section_menu[$i],'desc'=>'This title will display in the header menu. It is required');
  260. $options[] = array('name' => __('Section Background', 'onetone'),'id' => 'section_background_'.$i.'','std' => $section_background[$i],'type' => 'background' );
  261. $options[] = array('name' => __('Section Css Class', 'onetone'),'id' => 'section_css_class_'.$i.'','type' => 'text','std'=>$section_css_class[$i]);
  262. $options[] = array(
  263. 'name' => __('Sctions Content', 'onetone'),
  264. 'id' => 'sction_content_'.$i,
  265. 'std' => $section_content[$i],
  266. 'type' => 'editor');
  267.  
  268. $options[] = array('name' => '','id' => 'slide_group_end_'.$i.'','type' => 'end_group');
  269.  
  270. }
  271.  
  272. //END HOME PAGE SECTION
  273.  
  274. return $options;
  275. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement