Jump to content

Admin Home Slider


Recommended Posts

Bonjour,

 

Je suis en train de me faire une Menu dans l'administration pour afficher le contenu de homeslider.

 

Voila ce que j'ai dans mon display.

 

 

 



 public function display()

{
 $module = new HomeSlider;
$this->context->smarty->assign('content', $module->getContent());
parent::display();
 }


 

Ca marche presque sauf qu'il ne me prend pas en compte le chargement des javascript :

En fait il ne prend pas en compte la fonction

$this->_html .= $this->headerHTML();

 

Pour rappel elle contient :

 

 

public function headerHTML()
{
/*if (Tools::getValue('controller') != 'AdminModules' && Tools::getValue('configure') != $this->name)
return 'toto'.Tools::getValue('configure');*/

$this->context->controller->addJqueryUI('ui.sortable');
/* Style & js for fieldset 'slides configuration' */
$html = '
<style>
#slides li {
list-style: none;
margin: 0 0 4px 0;
padding: 10px;
background-color: #F4E6C9;
border: #CCCCCC solid 1px;
color:#000;
}
</style>
<script type="text/javascript" src="'.__PS_BASE_URI__.'js/jquery/jquery-ui.will.be.removed.in.1.6.js"></script>
<script type="text/javascript">
$(function() {
var $mySlides = $("#slides");
$mySlides.sortable({
opacity: 0.6,
cursor: "move",
update: function() {
var order = $(this).sortable("serialize") + "&action=updateSlidesPosition";
$.post("'._PS_BASE_URL_.__PS_BASE_URI__.'modules/'.$this->name.'/ajax_'.$this->name.'.php?secure_key='.$this->secure_key.'", order);
}
});
$mySlides.hover(function() {
$(this).css("cursor","move");
},
function() {
$(this).css("cursor","auto");
});
});
</script>';

return $html;
}

 

Merci de m'aider ?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...