PageRenderTime 46ms CodeModel.GetById 20ms RepoModel.GetById 0ms app.codeStats 0ms

/wp-content/themes/platform/sections/section.callout.php

https://bitbucket.org/crypticrod/sr_wp_code
PHP | 102 lines | 72 code | 19 blank | 11 comment | 6 complexity | cfd1cc41da8ca5a17a6c1511720144cb MD5 | raw file
Possible License(s): AGPL-1.0, GPL-2.0, LGPL-2.1, GPL-3.0, LGPL-2.0, AGPL-3.0
  1. <?php
  2. /*
  3. Section: News Banner
  4. Author: Adam Munns
  5. Description: Shows a callout banner with optional graphic call to action
  6. Version: 1.0.0
  7. */
  8. class PageLinesCallout extends PageLinesSection {
  9. function __construct( $registered_settings = array() ) {
  10. $name = __('Callout Section', 'pagelines');
  11. $id = 'callout';
  12. $default_settings = array(
  13. 'description' => 'Callout Section - A banner displaying a call to action or simple text.',
  14. 'workswith' => array('content'),
  15. 'folder' => '',
  16. 'init_file' => 'callout.php',
  17. 'icon' => CORE_IMAGES . '/admin/speaker.png'
  18. );
  19. $settings = wp_parse_args( $registered_settings, $default_settings );
  20. parent::__construct($name, $id, $settings);
  21. }
  22. function section_template() { ?>
  23. <div id="callout-area">
  24. <div class="callout_text">
  25. <div class="callout_text-pad">
  26. <h2 class="callout_head <?php if(!pagelines('pagelines_callout_image')):?>noimage<?php endif;?>">
  27. <?php print_pagelines_option('pagelines_callout_header', __('This is the "Callout Section"','pagelines') );?>
  28. </h2>
  29. <div class="callout_copy">
  30. <?php print_pagelines_option('pagelines_callout_subheader', __('Perfect for a call to action or a special offer.','pagelines') );?>
  31. </div>
  32. </div>
  33. </div>
  34. <?php if(pagelines_option('pagelines_callout_image')):?>
  35. <div class="callout_image">
  36. <a href="<?php echo pagelines_option('pagelines_callout_link');?>">
  37. <img src="<?php echo pagelines_option('pagelines_callout_image');?>" alt=""/>
  38. </a>
  39. </div>
  40. <?php endif;?>
  41. </div>
  42. <?php }
  43. function section_options($optionset = null, $location = null) {
  44. if($optionset == 'template_setup' && $location == 'bottom'){
  45. return array(
  46. 'pagelines_callout_text' => array(
  47. 'default' => '',
  48. 'type' => 'text_multi',
  49. 'inputlabel' => 'Enter text for your callout banner section',
  50. 'title' => $this->name.' Text',
  51. 'selectvalues'=> array(
  52. 'pagelines_callout_header' => array('inputlabel'=>'Callout Header', 'default'=> ''),
  53. 'pagelines_callout_subheader' => array('inputlabel'=>'Callout Text', 'default'=> ''),
  54. ),
  55. 'shortexp' => 'The text for the callout banner section',
  56. 'exp' => 'This text will be used as the title/text for the callout section of the theme.'
  57. ),
  58. 'pagelines_callout_image' => array(
  59. 'default' => THEME_IMAGES.'/callout_default.png',
  60. 'type' => 'image_upload',
  61. 'imagepreview' => '270',
  62. 'inputlabel' => 'Upload custom image',
  63. 'title' => $this->name.' Image',
  64. 'shortexp' => 'Input Full URL to your custom header or logo image.',
  65. 'exp' => 'Replaces the default callout image.'
  66. ),
  67. 'pagelines_callout_link' => array(
  68. 'default' => 'http://pagelines.com',
  69. 'type' => 'text',
  70. 'inputlabel' => 'Enter the link destination (URL)',
  71. 'title' => $this->name.' Image Link',
  72. 'shortexp' => 'The link destination of callout banner section',
  73. 'exp' => 'This URL will be used as the link for the callout section of the theme.'
  74. ),
  75. );
  76. }
  77. }
  78. }
  79. /*
  80. End of section class
  81. */