csf-group-fields.php (15020B)
1 <?php 2 /* 3 * @package Appside 4 * @since 1.0.0 5 * */ 6 7 if ( !defined('ABSPATH') ){ 8 exit(); // exit if access directly 9 } 10 11 12 if ( !class_exists('Appside_Group_Fields') ){ 13 14 class Appside_Group_Fields{ 15 /* 16 * $instance 17 * @since 1.0.0 18 * */ 19 private static $instance; 20 /* 21 * construct() 22 * @since 1.0.0 23 * */ 24 public function __construct() { 25 26 } 27 /* 28 * getInstance() 29 * @since 1.0.0 30 * */ 31 public static function getInstance(){ 32 if ( null == self::$instance ){ 33 self::$instance = new self(); 34 } 35 return self::$instance; 36 } 37 38 /** 39 * page layout options 40 * @since 1.0.0 41 * */ 42 public static function page_layout(){ 43 $fields = array( 44 array( 45 'type' => 'subheading', 46 'content' => esc_html__('Page Layouts & Colors Options','aapside'), 47 ), 48 array( 49 'id' => 'page_layout', 50 'type' => 'image_select', 51 'title' => esc_html__('Select Page Layout','aapside'), 52 'options' => array( 53 'default' => APPSIDE_THEME_SETTINGS_IMAGES .'/page/default.png', 54 'left-sidebar' => APPSIDE_THEME_SETTINGS_IMAGES .'/page/left-sidebar.png', 55 'right-sidebar' => APPSIDE_THEME_SETTINGS_IMAGES .'/page/right-sidebar.png', 56 'blank' => APPSIDE_THEME_SETTINGS_IMAGES .'/page/blank.png', 57 ), 58 'default' => 'default' 59 ), 60 array( 61 'id' => 'page_bg_color', 62 'type' => 'color', 63 'title' => esc_html__('Page Background Color','aapside'), 64 'default' => '#ffffff' 65 ), 66 array( 67 'id' => 'page_content_bg_color', 68 'type' => 'color', 69 'title' => esc_html__('Page Content Background Color','aapside'), 70 'default' => '#ffffff' 71 ) 72 ); 73 74 return $fields; 75 } 76 77 /** 78 * page container options 79 * @since 1.0.0 80 * */ 81 public static function Page_Container_Options($type){ 82 $fields = array(); 83 $allowed_html = Appside()->kses_allowed_html(array('mark')); 84 if ('header_options' == $type){ 85 $fields = array( 86 array( 87 'type' => 'subheading', 88 'content' => esc_html__('Page Header & Breadcrumb Options','aapside'), 89 ), 90 array( 91 'id' => 'navbar_build_type', 92 'title' => esc_html__('Header Type','aapside'), 93 'type' => 'select', 94 'options' => [ 95 'default' => esc_html__('Default','aapside'), 96 'header_builder' => esc_html__('Header Builder','aapside'), 97 ], 98 'default' => 'default', 99 'desc' => wp_kses(__('you can set <mark>header type</mark> default or use header builder design.','aapside'),$allowed_html), 100 ), 101 array( 102 'id' => 'navbar_type', 103 'title' => esc_html__('Header Style','aapside'), 104 'type' => 'image_select', 105 'options' => array( 106 'default' => APPSIDE_THEME_SETTINGS_IMAGES .'/header/02.jpg', 107 'style-01' => APPSIDE_THEME_SETTINGS_IMAGES .'/header/01.jpg', 108 'style-02' => APPSIDE_THEME_SETTINGS_IMAGES .'/header/03.png', 109 'style-03' => APPSIDE_THEME_SETTINGS_IMAGES .'/header/04.png', 110 ), 111 'default' => 'default', 112 'desc' => wp_kses(__('you can set <mark>header style</mark> from available design','aapside'),$allowed_html), 113 'dependency' => ['navbar_build_type','==','default'] 114 ), 115 array( 116 'id' => 'header_builder_style', 117 'title' => esc_html__('Header Builder Style','aapside'), 118 'type' => 'select', 119 'options' => Appside()->get_post_list_by_post_type('apside-hebuilder'), 120 'default' => 'black', 121 'desc' => wp_kses(__('you can set <mark>header builder style</mark> for this page.','aapside'),$allowed_html), 122 'dependency' => ['navbar_build_type','==','header_builder'] 123 ), 124 array( 125 'id' => 'footer_build_type', 126 'title' => esc_html__('Footer Type','aapside'), 127 'type' => 'select', 128 'options' => [ 129 'default' => esc_html__('Default','aapside'), 130 'footer_builder' => esc_html__('Footer Builder','aapside'), 131 ], 132 'default' => 'default', 133 'desc' => wp_kses(__('you can set <mark>footer type</mark> default or use header builder design.','aapside'),$allowed_html), 134 ), 135 array( 136 'id' => 'footer_builder_style', 137 'title' => esc_html__('Footer Builder Style','aapside'), 138 'type' => 'select', 139 'options' => Appside()->get_post_list_by_post_type('apside-foobuilder'), 140 'default' => 'black', 141 'desc' => wp_kses(__('you can set <mark>footer builder style</mark> for this page.','aapside'),$allowed_html), 142 'dependency' => ['footer_build_type','==','footer_builder'] 143 ), 144 array( 145 'id' => 'page_title', 146 'type' => 'switcher', 147 'title' => esc_html__('Page Title','aapside'), 148 'desc' => wp_kses(__('you can set <mark>ON / OFF</mark> to show/hide page title.','aapside'),$allowed_html), 149 'text_on' => esc_html__('Yes','aapside'), 150 'text_off' => esc_html__('No','aapside'), 151 'default' => true 152 ), 153 array( 154 'id' => 'page_breadcrumb', 155 'type' => 'switcher', 156 'title' => esc_html__('Page Breadcrumb','aapside'), 157 'desc' => wp_kses(__('you can set <mark>ON / OFF</mark> to show/hide page breadcrumb.','aapside'),$allowed_html), 158 'text_on' => esc_html__('Yes','aapside'), 159 'text_off' => esc_html__('No','aapside'), 160 'default' => true 161 ), 162 ); 163 }elseif ('container_options' == $type){ 164 $fields = array( 165 array( 166 'type' => 'subheading', 167 'content' => esc_html__('Page Width & Padding Options','aapside'), 168 ), 169 array( 170 'id' => 'page_container', 171 'type' => 'switcher', 172 'title' => esc_html__('Page Full Width','aapside'), 173 'desc' => wp_kses(__('you can set <mark>ON / OFF</mark> to set page container full width.','aapside'),$allowed_html), 174 'text_on' => esc_html__('Yes','aapside'), 175 'text_off' => esc_html__('No','aapside'), 176 'default' => false 177 ), 178 array( 179 'type' => 'subheading', 180 'content' => esc_html__('Page Spacing Options','aapside'), 181 ), 182 array( 183 'id' => 'page_spacing_top', 184 'title' => esc_html__('Page Spacing Top','aapside'), 185 'type' => 'slider', 186 'desc' => wp_kses(__('you can set <mark>Padding Top</mark> for page container.','aapside'),$allowed_html), 187 'min' => 0, 188 'max' => 500, 189 'step' => 1, 190 'unit' => 'px', 191 'default' => 120, 192 ), 193 array( 194 'id' => 'page_spacing_bottom', 195 'title' => esc_html__('Page Spacing Bottom','aapside'), 196 'type' => 'slider', 197 'desc' => wp_kses(__('you can set <mark>Padding Bottom</mark> for page container.','aapside'),$allowed_html), 198 'min' => 0, 199 'max' => 500, 200 'step' => 1, 201 'unit' => 'px', 202 'default' => 120, 203 ), 204 array( 205 'type' => 'subheading', 206 'content' => esc_html__('Page Content Spacing Options','aapside'), 207 ), 208 array( 209 'id' => 'page_content_spacing', 210 'type' => 'switcher', 211 'title' => esc_html__('Page Content Spacing','aapside'), 212 'desc' => wp_kses(__('you can set <mark>ON / OFF</mark> to set page content spacing.','aapside'),$allowed_html), 213 'text_on' => esc_html__('Yes','aapside'), 214 'text_off' => esc_html__('No','aapside'), 215 'default' => false 216 ), 217 array( 218 'id' => 'page_content_spacing_top', 219 'title' => esc_html__('Page Spacing Bottom','aapside'), 220 'type' => 'slider', 221 'desc' => wp_kses(__('you can set <mark>Padding Top</mark> for page content area.','aapside'),$allowed_html), 222 'min' => 0, 223 'max' => 500, 224 'step' => 1, 225 'unit' => 'px', 226 'default' => 0, 227 'dependency' => array('page_content_spacing' ,'==','true') 228 ), 229 array( 230 'id' => 'page_content_spacing_bottom', 231 'title' => esc_html__('Page Spacing Bottom','aapside'), 232 'type' => 'slider', 233 'desc' => wp_kses(__('you can set <mark>Padding Bottom</mark> for page content area.','aapside'),$allowed_html), 234 'min' => 0, 235 'max' => 500, 236 'step' => 1, 237 'unit' => 'px', 238 'default' => 0, 239 'dependency' => array('page_content_spacing' ,'==','true') 240 ), 241 array( 242 'id' => 'page_content_spacing_left', 243 'title' => esc_html__('Page Spacing Left','aapside'), 244 'type' => 'slider', 245 'desc' => wp_kses(__('you can set <mark>Padding Left</mark> for page content area.','aapside'),$allowed_html), 246 'min' => 0, 247 'max' => 500, 248 'step' => 1, 249 'unit' => 'px', 250 'default' => 0, 251 'dependency' => array('page_content_spacing' ,'==','true') 252 ), 253 array( 254 'id' => 'page_content_spacing_right', 255 'title' => esc_html__('Page Spacing Right','aapside'), 256 'type' => 'slider', 257 'desc' => wp_kses(__('you can set <mark>Padding Right</mark> for page content area.','aapside'),$allowed_html), 258 'min' => 0, 259 'max' => 500, 260 'step' => 1, 261 'unit' => 'px', 262 'default' => 0, 263 'dependency' => array('page_content_spacing' ,'==','true') 264 ), 265 ); 266 } 267 268 return $fields; 269 } 270 /** 271 * page layout options 272 * */ 273 public static function page_layout_options($title,$prefix){ 274 $allowed_html = Appside()->kses_allowed_html(array('mark')); 275 $fields = array( 276 array( 277 'type' => 'subheading', 278 'content' => '<h3>'.$title.esc_html__(' Page Options','aapside').'</h3>', 279 ), 280 array( 281 'id' => $prefix.'_layout', 282 'type' => 'image_select', 283 'title' => esc_html__('Select Page Layout','aapside'), 284 'options' => array( 285 'right-sidebar' => APPSIDE_THEME_SETTINGS_IMAGES .'/page/right-sidebar.png', 286 'left-sidebar' => APPSIDE_THEME_SETTINGS_IMAGES .'/page/left-sidebar.png', 287 'no-sidebar' => APPSIDE_THEME_SETTINGS_IMAGES .'/page/no-sidebar.png', 288 ), 289 'default' => 'right-sidebar' 290 ), 291 array( 292 'id' => $prefix.'_bg_color', 293 'type' => 'color', 294 'title' => esc_html__('Page Background Color','aapside'), 295 'default' => '#ffffff' 296 ), 297 array( 298 'id' => $prefix.'_spacing_top', 299 'title' => esc_html__('Page Spacing Top','aapside'), 300 'type' => 'slider', 301 'desc' => wp_kses(__('you can set <mark>Padding Top</mark> for page content area.','aapside'),$allowed_html), 302 'min' => 0, 303 'max' => 500, 304 'step' => 1, 305 'unit' => 'px', 306 'default' => 120, 307 ), 308 array( 309 'id' => $prefix.'_spacing_bottom', 310 'title' => esc_html__('Page Spacing Bottom','aapside'), 311 'type' => 'slider', 312 'desc' => wp_kses(__('you can set <mark>Padding Bottom</mark> for page content area.','aapside'),$allowed_html), 313 'min' => 0, 314 'max' => 500, 315 'step' => 1, 316 'unit' => 'px', 317 'default' => 120, 318 ), 319 ); 320 321 return $fields; 322 } 323 324 /** 325 * Post meta 326 * @since 1.0.0 327 * */ 328 public static function post_meta($prefix,$title){ 329 $allowed_html = Appside()->kses_allowed_html(array('mark')); 330 $fields = array( 331 array( 332 'type' => 'subheading', 333 'content' => '<h3>'.$title.esc_html__(' Post Options','aapside').'</h3>', 334 ), 335 array( 336 'id' => $prefix.'_posted_by', 337 'type' => 'switcher', 338 'title' => esc_html__('Posted By','aapside'), 339 'desc' => wp_kses(__('you can set <mark>ON / OFF</mark> to show / hide posted by.','aapside'),$allowed_html), 340 'text_on' => esc_html__('Yes','aapside'), 341 'text_off' => esc_html__('No','aapside'), 342 'default' => true 343 ), 344 array( 345 'id' => $prefix.'_posted_on', 346 'type' => 'switcher', 347 'title' => esc_html__('Posted On','aapside'), 348 'desc' => wp_kses(__('you can set <mark>ON / OFF</mark> to show / hide posted on.','aapside'),$allowed_html), 349 'text_on' => esc_html__('Yes','aapside'), 350 'text_off' => esc_html__('No','aapside'), 351 'default' => true 352 ) 353 ); 354 355 if ( 'blog_post' == $prefix){ 356 $fields[] = array( 357 'id' => $prefix.'_readmore_btn', 358 'type' => 'switcher', 359 'title' => esc_html__('Read More Button','aapside'), 360 'desc' => wp_kses(__('you can set <mark>ON / OFF</mark> to show / hide read more button.','aapside'),$allowed_html), 361 'text_on' => esc_html__('Yes','aapside'), 362 'text_off' => esc_html__('No','aapside'), 363 'default' => true 364 ); 365 $fields[] = array( 366 'id' => $prefix.'_readmore_btn_text', 367 'type' => 'text', 368 'title' => esc_html__('Read More Text','aapside'), 369 'desc' => wp_kses(__('you can set read more <mark>button text</mark> to button text.','aapside'),$allowed_html), 370 'default' => esc_html__('Read More','aapside'), 371 'dependency' => array($prefix.'_readmore_btn' ,'==','true') 372 ); 373 $fields[] = array( 374 'id' => $prefix.'_excerpt_more', 375 'type' => 'text', 376 'title' => esc_html__('Excerpt More','aapside'), 377 'desc' => wp_kses(__('you can set read more <mark>button text</mark> to button text.','aapside'),$allowed_html), 378 'attributes' => array( 379 'placeholder' => esc_html__('....','aapside') 380 ) 381 ); 382 $fields[] = array( 383 'id' => $prefix.'_excerpt_length', 384 'type' => 'select', 385 'options' => array( 386 '25' => esc_html__('Short','aapside'), 387 '55' => esc_html__('Regular','aapside'), 388 '100' => esc_html__('Long','aapside'), 389 ), 390 'title' => esc_html__('Excerpt Length','aapside'), 391 'desc' => wp_kses(__('you can set <mark> excerpt length</mark> for post.','aapside'),$allowed_html), 392 ); 393 }elseif('blog_single_post' == $prefix){ 394 395 $fields[] =array( 396 'id' => $prefix.'_posted_category', 397 'type' => 'switcher', 398 'title' => esc_html__('Posted Category','aapside'), 399 'desc' => wp_kses(__('you can set <mark>ON / OFF</mark> to show / hide posted category.','aapside'),$allowed_html), 400 'text_on' => esc_html__('Yes','aapside'), 401 'text_off' => esc_html__('No','aapside'), 402 'default' => true 403 ); 404 $fields[] = array( 405 'id' => $prefix.'_posted_tag', 406 'type' => 'switcher', 407 'title' => esc_html__('Posted Tags','aapside'), 408 'desc' => wp_kses(__('you can set <mark>ON / OFF</mark> to show / hide post tags.','aapside'),$allowed_html), 409 'text_on' => esc_html__('Yes','aapside'), 410 'text_off' => esc_html__('No','aapside'), 411 'default' => true 412 ); 413 $fields[] = array( 414 'id' => $prefix.'_posted_share', 415 'type' => 'switcher', 416 'title' => esc_html__('Post Share','aapside'), 417 'desc' => wp_kses(__('you can set <mark>ON / OFF</mark> to show / hide post share.','aapside'),$allowed_html), 418 'text_on' => esc_html__('Yes','aapside'), 419 'text_off' => esc_html__('No','aapside'), 420 'default' => true 421 ); 422 } 423 424 return $fields; 425 } 426 427 }//end class 428 429 }//end if 430