Created
October 1, 2013 17:06
-
-
Save allgood2386/6781784 to your computer and use it in GitHub Desktop.
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
<?php | |
function custom_blocks_block_info() { | |
$blocks['left_social'] = array( | |
// info: The name of the block. | |
'info' => t('Social Header Left'), | |
); | |
return $blocks; | |
} | |
function custom_blocks_block_view($delta = '') { | |
$theme_image_path = base_path().path_to_theme().'/images'; | |
// The $delta parameter tells us which block is being requested. | |
switch ($delta) { | |
case 'left_social': | |
// Create your block content here | |
//$block['subject'] = t('Sample Title Block'); | |
$block['content'] = ' | |
<span class="connect-label">CONNECT WITH ME!</span> | |
<span class="icon-stack"> | |
<a href="/index/rss.xml"> | |
<i class="icon-sign-blank icon-stack-base"></i> | |
<i class="icon-rss icon-light"></i> | |
</a> | |
</span> | |
<span class="icon-stack"> | |
<a href="http://www.twitter.com"> | |
<i class="icon-sign-blank icon-stack-base"></i> | |
<i class="icon-twitter icon-light"></i> | |
</a> | |
</span> | |
<span class="icon-stack"> | |
<a href="http://www.facebook.com"> | |
<i class="icon-sign-blank icon-stack-base"></i> | |
<i class="icon-facebook icon-light"></i> | |
</a> | |
</span> | |
'; | |
break; | |
} | |
return $block; | |
} | |
function custom_blocks_block_configure($delta='') { | |
$form = array(); | |
switch($delta) { | |
case 'left_social': | |
$form['social_block_facebook'] = array( | |
'#type' => 'checkbox', | |
'#title' => t('Facebook'), | |
'#default_value' => variable_get('social_block_facebook', 0), | |
'#options' => drupal_map_assoc(array(0,1)), | |
); | |
$form['social_block_twitter'] = array( | |
'#type' => 'checkbox', | |
'#title' => t('Facebook'), | |
'#default_value' => variable_get('social_block_twitter', 0), | |
'#options' => drupal_map_assoc(array(0,1)), | |
); | |
break; | |
} | |
return $form; | |
} | |
function custom_blocks_block_save($delta='', $edit = array()) { | |
switch($delta) { | |
case 'left_social': | |
variable_set('social_block_facebook', $edit['social_block_facebook']); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment