public
Last active

Fields login button

  • Download Gist
gistfile1.php
PHP
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145
<?php
/**
*
* @author alexhermann
*
*/
$fields['login_button'] = array(
 
'title_config' => array(
'type'=>'html',
'html'=> '
<h1>'.__('Configure the button',$this->ptd).'</h1>
',
'widget_no_display' => true
),
'start_config' => array(
'type'=>'html',
'html'=> '
<div class="row">
'
),
'widget_title'=> array(
'type'=> 'text',
'label'=> __('Title',$this->ptd),
'class'=>'span4',
'attr'=> array('class'=>'span4'),
'widget_only' => true
),
'display_on_login_page'=> array(
'type'=> 'select',
'options' => array(
array('value'=>'0', 'label'=>__('No',$this->ptd)),
array('value'=>'1', 'label'=>__('Yes',$this->ptd)),
),
'label'=> __('Display on Login',$this->ptd),
'class'=>'span2',
'attr'=> array('class'=>'span2'),
'widget_no_display' => true
),
'login_redirect_url'=> array(
'type'=> 'text',
'label'=> __('Url after login',$this->ptd),
'class'=>'span2',
'attr'=> array('class'=>'span2')
),
'logout_redirect_url'=> array(
'type'=> 'text',
'label'=> __('Url after lgout',$this->ptd),
'class'=>'span2',
'attr'=> array('class'=>'span2')
),
'logout_label'=> array(
'type'=> 'text',
'label'=> __('Logout Label',$this->ptd),
'class'=>'span2',
'attr'=> array('class'=>'span2')
),
'show_profile_picture'=> array(
'type'=> 'select',
'options' => array(
array('value'=>'0', 'label'=>__('No',$this->ptd)),
array('value'=>'1', 'label'=>__('Yes',$this->ptd)),
),
'label'=> __('Show profile picture',$this->ptd),
'class'=>'span2',
'attr'=> array('class'=>'span2')
),
'show_faces'=> array(
'type'=> 'select',
'options' => array(
array('value'=>'0', 'label'=>__('No',$this->ptd)),
array('value'=>'1', 'label'=>__('Yes',$this->ptd)),
),
'label'=> __('Show faces',$this->ptd),
'class'=>'span2',
'attr'=> array('class'=>'span2')
),
'maxrow'=> array(
'type'=> 'text',
'label'=> __('Max row',$this->ptd),
'class'=>'span2',
'attr'=> array('class'=>'span2 depend_login_button_show_faces', 'disabled'=>($this->options['login_button']['show_faces'] == "0" ? 'disabled' : ''))
),
'width'=> array(
'type'=> 'text',
'label'=> __('Width of button',$this->ptd),
'class'=>'span2',
'attr'=> array('class'=>'span2')
),
'image'=> array(
'type'=> 'media',
'label'=> __('Button Image',$this->ptd),
'class'=> 'span8',
'attr'=> array('class'=>'span6')
),
 
'end_config' => array(
'type'=>'html',
'html'=> '
</div>
'
),
'preview' => array(
'type'=>'html',
'html'=> '
<h1>'.__('Preview',$this->ptd).'</h1>
<div class="well">'.$this->get_the_login_button().'</div>
<h1>'.__('Options List',$this->ptd).'</h1>
<table class="table table-bordered table-condensed table-striped">
<thead>
<tr>
<th>Option</th>
<th>Value</th>
</tr>
</thead>
<tbody>
<tr><td>profile_picture</td><td>0 or 1</td></tr>
<tr><td>faces</td><td>0 or 1</td></tr>
<tr><td>maxrow</td><td>number (only if faces = 1)</td></tr>
<tr><td>login_url</td><td>string</td></tr>
<tr><td>logout_url</td><td>string</td></tr>
<tr><td>width</td><td>number</td></tr>
<tr><td>image</td><td>url</td></tr>
</tbody>
<tfoot>
<tr><th colspan="2">[AWD_loginbutton option="value"]</th></tr>
</tfoot>
</table>
',
'widget_no_display' => true
)
);
?>

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.