This repository has been archived by the owner on Feb 24, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
39dde7b
commit 193cbb0
Showing
5 changed files
with
153 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
70 changes: 70 additions & 0 deletions
70
...ent/themes/Akvo-responsive/so-widgets/akvo-downloads-dropdown/akvo-downloads-dropdown.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
<?php | ||
/* | ||
Widget Name: Akvo Downloads Dropdown | ||
Description: Downloads Dropdown - created for organisations page | ||
Author: Samuel Thomas, Akvo | ||
Author URI: | ||
Widget URI: | ||
Video URI: | ||
*/ | ||
|
||
class Akvo_Downloads_Dropdown extends SiteOrigin_Widget { | ||
|
||
function __construct() { | ||
//Here you can do any preparation required before calling the parent constructor, such as including additional files or initializing variables. | ||
|
||
//Call the parent constructor with the required arguments. | ||
parent::__construct( | ||
// The unique id for your widget. | ||
'akvo-downloads-dropdown', | ||
|
||
// The name of the widget for display purposes. | ||
__('Akvo Downloads Dropdown', 'siteorigin-widgets'), | ||
|
||
// The $widget_options array, which is passed through to WP_Widget. | ||
// It has a couple of extras like the optional help URL, which should link to your sites help or support page. | ||
array( | ||
'description' => __('Downloads Dropdown - created for organisations page', 'siteorigin-widgets'), | ||
'help' => '', | ||
), | ||
|
||
//The $control_options array, which is passed through to WP_Widget | ||
array(), | ||
|
||
//The $form_options array, which describes the form fields used to configure SiteOrigin widgets. We'll explain these in more detail later. | ||
array( | ||
'downloads' => array( | ||
'type' => 'repeater', | ||
'label' => __( 'Downloads Section' , 'siteorigin-widgets' ), | ||
'item_name' => __( 'Repeater item', 'siteorigin-widgets' ), | ||
'fields' => array( | ||
'label' => array( | ||
'type' => 'text', | ||
'label' => __( 'Download Label', 'siteorigin-widgets' ) | ||
), | ||
'link' => array( | ||
'type' => 'text', | ||
'label' => __( 'Download Link', 'siteorigin-widgets' ) | ||
), | ||
) | ||
) | ||
), | ||
|
||
//The $base_folder path string. | ||
get_template_directory()."/so-widgets/akvo-downloads-dropdown" | ||
); | ||
} | ||
|
||
function get_template_name($instance) { | ||
return 'template'; | ||
} | ||
|
||
function get_template_dir($instance) { | ||
return 'templates'; | ||
} | ||
|
||
function get_style_name($instance) { | ||
return ''; | ||
} | ||
} | ||
siteorigin_widget_register('akvo-downloads-dropdown', __FILE__, 'Akvo_Downloads_Dropdown'); |
44 changes: 44 additions & 0 deletions
44
...-content/themes/Akvo-responsive/so-widgets/akvo-downloads-dropdown/templates/template.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<?php if( isset( $instance['downloads'] ) ):?> | ||
<div class="fullWidthParag" data-behaviour='downloads-dropdown'> | ||
<select class="articlesdropdown selectpicker" data-style="btn-primary"> | ||
<option class="selectdownloadoption" disabled selected>Click here to select your download</option> | ||
<?php foreach( $instance['downloads'] as $download ):?> | ||
<option value="<?php _e( $download['link'] );?>"><?php _e( $download['label'] );?></option> | ||
<?php endforeach;?> | ||
</select> | ||
<a href="#" target='_blank' class="buttonblack">Download</a> | ||
</div> | ||
<style> | ||
|
||
[data-behaviour~=downloads-dropdown] .buttonblack{ | ||
font-size: 16px; | ||
-ms-box-sizing : border-box; | ||
-moz-box-sizing : border-box; | ||
box-sizing : border-box; | ||
font-family : Arial, Helvetica, Geneva, sans-serif; | ||
padding : 1em 2em; | ||
background : transparent; | ||
border : 2px solid #000000; | ||
color : #000000; | ||
-webkit-border-radius : 0em; | ||
-moz-border-radius : 0em; | ||
border-radius : 0em; | ||
text-shadow : 0 1px 0 rgba(0, 0, 0, 0.05); | ||
text-align : center; | ||
display : inline-block; | ||
cursor : pointer; | ||
text-decoration : none; | ||
line-height : 1em; | ||
margin : 0 auto; | ||
} | ||
|
||
.articlesdropdown{ | ||
padding : 17px 10px; | ||
width : 80%; | ||
margin-right : 2%; | ||
display : inline-block; | ||
-webkit-appearance : none; | ||
} | ||
</style> | ||
<?php endif; ?> | ||
|