$this->addJqueryUi('ui.widget'); $this->addJqueryPlugin('tagify'); } public function renderForm() { $this->toolbar_btn['save-and-stay'] = array('href' => '#', 'desc' => $this->l('Save and stay')); $this->initToolbar(); $this->fields_form = array('tinymce' => true, 'legend' => array('title' => $this->l('Friend Image/Video'), 'image' => '../img/admin/tab-categories.gif'), 'input' => array(array('type' => 'text', 'label' => $this->l('Title:'), 'name' => 'title', 'required' => true, 'lang' => true, 'class' => 'copy2friendlyUrl', 'hint' => $this->l('Invalid characters:') . ' <>;=#{}'), array('type' => 'text', 'label' => $this->l('Video ID:'), 'name' => 'youtube_id', 'class' => 'copy2friendlyUrl', 'hint' => $this->l('This is the id of youtube video')), array('type' => 'file', 'label' => $this->l('Image:'), 'name' => 'image', 'display_image' => true)), 'submit' => array('title' => $this->l('Save'), 'class' => 'button')); $this->fields_form['input'][] = array('type' => 'text', 'label' => $this->l('Position :'), 'size' => 3, 'name' => 'position'); $friends = FriendsInfo::listFriends(); $this->fields_form['input'][] = array('type' => 'select', 'label' => $this->l('Friend'), 'desc' => $this->l('Choose a friend'), 'name' => 'id_friend', 'required' => true, 'options' => array('query' => $friends, 'id' => 'id_option', 'name' => 'name')); $this->fields_form['input'][] = array('type' => 'radio', 'label' => $this->l('Status :'), 'name' => 'active', 'required' => false, 'class' => 't', 'is_bool' => true, 'values' => array(array('id' => 'active_on', 'value' => 1, 'label' => $this->l('Enabled')), array('id' => 'active_off', 'value' => 0, 'label' => $this->l('Disabled')))); if (!($friends = $this->loadObject(true))) { return; } // $image = ImageManager::thumbnail(_PS_MYFRIENDS_IMG_DIR_.'/'.$friends->id.'.jpg', $this->table.'_'.(int)$friends->id.'.'.$this->imageType, 350, $this->imageType, true); // $this->fields_value = array( // 'image' => $image ? $image : false, // 'size' => $image ? filesize(_PS_MYFRIENDS_IMG_DIR_.'/'.$friends->id.'.jpg') / 1000 : false