Jump to content

how skype module position in top of page ?


Recommended Posts

use this code for blockskype.php

 

<?php
class BlockSkype extends Module
{
function __construct()
{
 $this->name = 'blockskype';
 $this->tab = 'Blocks';
 $this->version = 0.2;
 parent::__construct(); // The parent construct is required for translations
 $this->page = basename(__FILE__, '.php');
 $this->displayName = $this->l('Block Skype');
 $this->description = $this->l('Adds a block to display an Skype');

 if (!Configuration::get('COD_SKYPE'))
  $this->warning = $this->l('You have not yet set your Skipe code');
    $this->description = $this->l('Integrate Skype into your shop');
 $this->confirmUninstall = $this->l('Are you sure you want to delete your details ?');
}
function install()
{
 if (!parent::install())
  return false;
 if (!$this->registerHook('rightColumn') OR !$this->registerHook('leftColumn')) OR !$this->registerHook('top'))
  return false;
 return true;
}
/**
* Returns module content
*
* @param array $params Parameters
* @return string Content
*/

 function hookLeftColumn($params)
{

   global $smarty;
 //$smarty->output_charset = 'HTML';
 $skypecod=Configuration::get('COD_SKYPE');
 //$skypecod=html_entity_decode($skypecod);
 $smarty->assign('skype',$skypecod);

 return $this->display(__FILE__, 'blockskype.tpl');
}

function hookRightColumn($params)
{
 return $this->hookLeftColumn($params);
}

   function hookTop($params)
{
 return $this->hookLeftColumn($params);
}


   public function getContent()
{
 $output = '<h2>'.$this->displayName.'</h2>';
 if (Tools::isSubmit('submitSKYPE') AND ($gai = Tools::getValue('cod_skype')))
 {
  //$gai = htmlentities($gai, ENT_COMPAT, 'UTF-8');
  Configuration::updateValue('COD_SKYPE', $gai, true);
  $output .= '
  <div class="conf confirm">
   <img src="../img/admin/ok.gif" alt="" title="" />
   '.$this->l('Settings updated').'
  </div>';
 }
 return $output.$this->displayForm();
}
public function displayForm()
{
 $output = '
 <form action="'.$_SERVER['REQUEST_URI'].'" method="post">
  <fieldset><legend>'.$this->l('Settings').'</legend>
   <label>'.$this->l('Your code Skype').'</label>
   <div class="margin-form">
 <textarea name="cod_skype" cols="90" rows="10" />'.Tools::getValue('cod_skype', Configuration::get('COD_SKYPE')).'</textarea>

   </div>
   <center><input type="submit" name="submitSKYPE" value="'.$this->l('Update settings').'" class="button" /></center>  
  </fieldset>
 </form>';
 return $output;
}


}
?>

 

reinstall module.

 

i think that after that, also css modification will be necessary

Link to comment
Share on other sites

×
×
  • Create New...