Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*------------------------------------------------------------------------
- # socialsite.php - Module - My Social Time Line
- # ------------------------------------------------------------------------
- # author Codeboxr Team
- # copyright Copyright (C) 2010-2012 codeboxr.com. All Rights Reserved.
- # @license - http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
- # Websites: http://codeboxr.com
- # Technical Support: Forum - http://codeboxr.com/product/my-social-timeline-for-joomla
- -------------------------------------------------------------------------*/
- // no direct access
- defined( '_JEXEC' ) or die( 'Restricted access' );
- jimport('joomla.form.helper');
- JFormHelper::loadFieldClass('list');
- class JFormFieldSocialsite extends JFormFieldList{
- protected $type = 'socialsite';
- protected function getInput(){
- $html = array();
- $attr = '';
- // Initialize some field attributes.
- $attr .= $this->element['class'] ? ' class="' . (string) $this->element['class'] . '"' : '';
- // To avoid user's confusion, readonly="true" should imply disabled="true".
- if ((string) $this->element['readonly'] == 'true' || (string) $this->element['disabled'] == 'true')
- {
- $attr .= ' disabled="disabled"';
- }
- $attr .= $this->element['size'] ? ' size="' . (int) $this->element['size'] . '"' : '';
- $attr .= $this->multiple ? ' multiple="multiple"' : '';
- // Initialize JavaScript field attributes.
- $attr .= $this->element['onchange'] ? ' onchange="' . (string) $this->element['onchange'] . '"' : '';
- // Get the field options.
- //$options = (array) $this->getOptions();
- $sites = array('facebook' => 'Facebook', 'twitter' => 'Twitter', 'gplus' => 'Google Plus', 'delicious' => 'Delicious', 'flickr' => 'Flickr', 'linkedin' => 'Linkedin', 'pinterest' => 'Pinterest', 'youtube' => 'Youtube'
- , 'blogspot' => 'Blogspot', 'wordpress' => 'Wordpress','tumblr' => 'Tumblr', 'reddit' => 'Reddit', 'myspace' => 'Myspace', 'lastfm' => 'Last.fm','foursquare' => 'Foursquare', 'instagram' => 'Instagram','customfeed'=>'Custom Feeds','comcontent'=>'Latest Content Articles','comk2'=>'Latest K2 Articles' );
- $networks = array();
- foreach($sites as $key => $val) :
- $networks[] = JHTML::_('select.option', $key, $val);
- endforeach;
- // Create a read-only list (no name) with a hidden input to store the value.
- if ((string) $this->element['readonly'] == 'true')
- {
- $html[] = JHtml::_('select.genericlist', $networks, '', trim($attr), 'value', 'text', $this->value, $this->id);
- $html[] = '<input type="hidden" name="' . $this->name . '" value="' . $this->value . '"/>';
- }
- // Create a regular list.
- else
- {
- $html[] = JHtml::_('select.genericlist', $networks, $this->name, trim($attr), 'value', 'text', $this->value, $this->id);
- }
- return implode($html);
- }//end function fectchElement
- }//end class
- ?>
Advertisement
Add Comment
Please, Sign In to add comment