本文整理匯總了PHP中ImageType::getImagesTypes方法的典型用法代碼示例。如果您正苦於以下問題:PHP ImageType::getImagesTypes方法的具體用法?PHP ImageType::getImagesTypes怎麽用?PHP ImageType::getImagesTypes使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ImageType
的用法示例。
在下文中一共展示了ImageType::getImagesTypes方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: renderForm
public function renderForm($args, $data)
{
$helper = $this->getFormHelper();
$imagesTypes = ImageType::getImagesTypes('manufacturers');
$this->fields_form[1]['form'] = array('legend' => array('title' => $this->l('Widget Form.')), 'input' => array(array('type' => 'html', 'html_content' => 'Please access <a href="http://apollotheme.com/" target="_blank" title="apollo site">Apollotheme.com</a> to buy professional version to use this '), array('type' => 'html', 'html_content' => '<a target="_blank" href="http://apollotheme.com/how-to-buy-pro-version/" target="_blank" title="How to buy">How to buy Professional Version</a>'), array('type' => 'html', 'html_content' => '<a target="_blank" href="http://apollotheme.com/different-between-free-pro-version/" target="_blank" title="Why should use">Why should use Professional Version</a>')), 'buttons' => array(array('title' => $this->l('Save And Stay'), 'icon' => 'process-icon-save', 'class' => 'pull-right', 'type' => 'submit', 'name' => 'saveandstayleotempcp'), array('title' => $this->l('Save'), 'icon' => 'process-icon-save', 'class' => 'pull-right', 'type' => 'submit', 'name' => 'saveleotempcp')));
$default_lang = (int) Configuration::get('PS_LANG_DEFAULT');
$helper->tpl_vars = array('fields_value' => $this->getConfigFieldsValues($data), 'languages' => Context::getContext()->controller->getLanguages(), 'id_language' => $default_lang);
return $helper->generateForm($this->fields_form);
}
示例2: makeFormConfigs
public function makeFormConfigs()
{
if ($this->_fields_form) {
return;
}
$imagesTypes = ImageType::getImagesTypes('manufacturers');
$fields_form = array('form' => array('legend' => array('title' => $this->l('Settings'), 'icon' => 'icon-cogs'), 'input' => array(array('type' => 'text', 'label' => $this->l('Colums In Tab.'), 'name' => $this->renderName('col'), 'desc' => $this->l('The maximum column items in tab.'), 'default' => 3), array('type' => 'text', 'label' => $this->l('Manufacturers Per Page:'), 'name' => $this->renderName('page'), 'desc' => $this->l('The maximum number of manufacturers displayed in this block.'), 'required' => true, 'default' => 6), array('type' => 'switch', 'label' => $this->l('Show title:'), 'name' => $this->renderName('active_title'), 'is_bool' => true, 'desc' => 'Display or none display Module title.', 'values' => array(array('id' => 'active_on', 'value' => 1, 'label' => $this->l('Yes')), array('id' => 'active_off', 'value' => 0, 'label' => $this->l('No'))), 'default' => 0), array('type' => 'switch', 'label' => $this->l('Auto play:'), 'name' => $this->renderName('active_play'), 'is_bool' => true, 'desc' => 'For carousel.', 'values' => array(array('id' => 'active_on', 'value' => 1, 'label' => $this->l('Yes')), array('id' => 'active_off', 'value' => 0, 'label' => $this->l('No'))), 'default' => 0), array('type' => 'select', 'label' => $this->l('Shipping method:'), 'desc' => $this->l('Type image'), 'name' => $this->renderName('type_img'), 'required' => true, 'options' => array('query' => $imagesTypes, 'id' => 'name', 'name' => 'name'), 'default' => 'pf_manufacturer'), array('type' => 'text', 'label' => $this->l('Interval .'), 'name' => $this->renderName('intv'), 'desc' => $this->l('Enter Time(miniseconds) to play carousel. Value 1 to stop.'), 'default' => 8000)), 'submit' => array('title' => $this->l('Save'), 'class' => 'btn btn-default')));
$this->_fields_form[] = $fields_form;
}
示例3: renderForm
public function renderForm($args, $data)
{
$helper = $this->getFormHelper();
$imagesTypes = ImageType::getImagesTypes('manufacturers');
$this->fields_form[1]['form'] = array('legend' => array('title' => $this->l('Widget Form.')), 'input' => array(array('type' => 'text', 'label' => $this->l('Limit'), 'name' => 'limit', 'default' => 10), array('type' => 'select', 'label' => $this->l('Image:'), 'desc' => $this->l('Select type image for manufacture.'), 'name' => 'image', 'default' => 'small' . '_default', 'options' => array('query' => $imagesTypes, 'id' => 'name', 'name' => 'name'))), 'buttons' => array(array('title' => $this->l('Save And Stay'), 'icon' => 'process-icon-save', 'class' => 'pull-right', 'type' => 'submit', 'name' => 'saveandstayleotempcp'), array('title' => $this->l('Save'), 'icon' => 'process-icon-save', 'class' => 'pull-right', 'type' => 'submit', 'name' => 'saveleotempcp')));
$default_lang = (int) Configuration::get('PS_LANG_DEFAULT');
$helper->tpl_vars = array('fields_value' => $this->getConfigFieldsValues($data), 'languages' => Context::getContext()->controller->getLanguages(), 'id_language' => $default_lang);
return $helper->generateForm($this->fields_form);
}
示例4: renderForm
public function renderForm($args, $data)
{
$helper = $this->getFormHelper();
$imagesTypes = ImageType::getImagesTypes('manufacturers');
$this->fields_form[1]['form'] = array('legend' => array('title' => $this->l('Widget Form.')), 'input' => array(array('type' => 'text', 'label' => $this->l('Items Per Page'), 'name' => 'itemspage', 'default' => 3, 'desc' => $this->l('The maximum number of products in each page Carousel (default: 3).')), array('type' => 'text', 'label' => $this->l('Colums In Tab'), 'name' => 'columns', 'default' => 3, 'desc' => 'The maximum column products in each page Carousel (default: 3).'), array('type' => 'text', 'label' => $this->l('Items In Tab'), 'name' => 'itemstab', 'default' => 6, 'desc' => $this->l('The maximum number of products in each Carousel (default: 6).')), array('type' => 'select', 'label' => $this->l('Image:'), 'desc' => $this->l('Select type image for manufacture.'), 'name' => 'image', 'default' => 'small_' . 'default', 'options' => array('query' => $imagesTypes, 'id' => 'name', 'name' => 'name')), array('type' => 'text', 'label' => $this->l('Interval'), 'name' => 'interval', 'default' => 8000, 'desc' => $this->l('Enter Time(miniseconds) to play carousel. Value 0 to stop.'))), 'buttons' => array(array('title' => $this->l('Save And Stay'), 'icon' => 'process-icon-save', 'class' => 'pull-right', 'type' => 'submit', 'name' => 'saveandstayleotempcp'), array('title' => $this->l('Save'), 'icon' => 'process-icon-save', 'class' => 'pull-right', 'type' => 'submit', 'name' => 'saveleotempcp')));
$default_lang = (int) Configuration::get('PS_LANG_DEFAULT');
$helper->tpl_vars = array('fields_value' => $this->getConfigFieldsValues($data), 'languages' => Context::getContext()->controller->getLanguages(), 'id_language' => $default_lang);
return $helper->generateForm($this->fields_form);
}
示例5: afterImageUpload
public function afterImageUpload()
{
/* Generate image with differents size */
if ($id_manufacturer = intval(Tools::getValue('id_manufacturer')) and isset($_FILES) and count($_FILES) and file_exists(_PS_MANU_IMG_DIR_ . $id_manufacturer . '.jpg')) {
$imagesTypes = ImageType::getImagesTypes('manufacturers');
foreach ($imagesTypes as $k => $imageType) {
imageResize(_PS_MANU_IMG_DIR_ . $id_manufacturer . '.jpg', _PS_MANU_IMG_DIR_ . $id_manufacturer . '-' . stripslashes($imageType['name']) . '.jpg', intval($imageType['width']), intval($imageType['height']));
}
}
}
示例6: postImage
protected function postImage($id)
{
$ret = parent::postImage($id);
if ($id_store = (int) Tools::getValue('id_store') and isset($_FILES) and sizeof($_FILES) and file_exists(_PS_STORE_IMG_DIR_ . $id_store . '.jpg')) {
$imagesTypes = ImageType::getImagesTypes('stores');
foreach ($imagesTypes as $k => $imageType) {
imageResize(_PS_STORE_IMG_DIR_ . $id_store . '.jpg', _PS_STORE_IMG_DIR_ . $id_store . '-' . stripslashes($imageType['name']) . '.jpg', (int) $imageType['width'], (int) $imageType['height']);
}
}
return $ret;
}
示例7: postImage
protected function postImage($id)
{
$ret = parent::postImage($id);
if ($id_category = intval(Tools::getValue('id_category')) and isset($_FILES) and sizeof($_FILES) and file_exists(_PS_CAT_IMG_DIR_ . $id_category . '.jpg')) {
$imagesTypes = ImageType::getImagesTypes('categories');
foreach ($imagesTypes as $k => $imageType) {
imageResize(_PS_CAT_IMG_DIR_ . $id_category . '.jpg', _PS_CAT_IMG_DIR_ . $id_category . '-' . stripslashes($imageType['name']) . '.jpg', intval($imageType['width']), intval($imageType['height']));
}
}
return $ret;
}
示例8: __construct
public function __construct()
{
$this->table = 'powatag_configuration';
$this->lang = false;
$this->_select = null;
//If needed you can add informations to select issued from other databases
$this->_join = null;
//Join the databases here
parent::__construct();
$this->bootstrap = true;
$this->fields_options = array('api_settings' => array('title' => $this->l('API Settings'), 'image' => '../img/admin/prefs.gif', 'fields' => array('POWATAG_API_KEY' => array('title' => $this->l('API Key'), 'validation' => 'isString', 'type' => 'text', 'size' => '80', 'visibility' => Shop::CONTEXT_SHOP, 'required' => true), 'POWATAG_HMAC_KEY' => array('title' => $this->l('HMAC Key'), 'validation' => 'isString', 'type' => 'text', 'visibility' => Shop::CONTEXT_SHOP, 'size' => 80, 'required' => true), 'POWATAG_GENERATOR_URL' => array('title' => $this->l('Powatag Endpoint URL'), 'validation' => 'isString', 'type' => 'text', 'size' => 80), 'POWATAG_JS_URL' => array('title' => $this->l('Head JavaScript URL'), 'validation' => 'isString', 'type' => 'text', 'size' => 80), 'POWATAG_CSS_URL' => array('title' => $this->l('Head CSS URL'), 'validation' => 'isString', 'type' => 'text', 'size' => 80), 'POWATAG_LEGACY_ERRORS' => array('title' => $this->l('Legacy error codes enabled'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool', 'visibility' => Shop::CONTEXT_SHOP)), 'submit' => array('title' => $this->l('Save'))), 'other_settings' => array('title' => $this->l('Other Settings'), 'image' => '../img/admin/tab-tools.gif', 'fields' => array('POWATAG_SHIPPING' => array('title' => $this->l('Shipping Method'), 'validation' => 'isInt', 'type' => 'select', 'identifier' => 'id_carrier', 'desc' => $this->l('This will be used to calculate shipping costs'), 'list' => Carrier::getCarriers($this->context->language->id, false, false, false, null, Carrier::ALL_CARRIERS), 'visibility' => Shop::CONTEXT_SHOP, 'required' => true), 'POWATAG_SUCCESS_MSG' => array('title' => $this->l('Sucess message'), 'validation' => 'isString', 'type' => 'textLang', 'size' => '80', 'visibility' => Shop::CONTEXT_SHOP), 'POWATAG_IMG_TYPE' => array('title' => $this->l('Image type to send'), 'validation' => 'isInt', 'type' => 'select', 'identifier' => 'id_image_type', 'list' => ImageType::getImagesTypes(), 'visibility' => Shop::CONTEXT_SHOP, 'required' => true)), 'submit' => array('title' => $this->l('Save'))), 'product_settings' => array('title' => $this->l('Product Settings'), 'image' => $this->module->getPathUri() . 'img/qr_code.png', 'fields' => array('POWATAG_QR' => array('title' => $this->l('QR Code enabled'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool', 'visibility' => Shop::CONTEXT_SHOP), 'POWATAG_QR_POS' => array('title' => $this->l('QR code Position'), 'validation' => 'isString', 'type' => 'select', 'identifier' => 'key', 'list' => array(array('key' => 'displayRightColumnProduct', 'name' => $this->l('displayRightColumnProduct')), array('key' => 'displayLeftColumnProduct', 'name' => $this->l('displayLeftColumnProduct')), array('key' => 'displayFooterProduct', 'name' => $this->l('displayFooterProduct')), array('key' => 'displayProductButtons', 'name' => $this->l('displayProductButtons'))), 'visibility' => Shop::CONTEXT_SHOP), 'POWATAG_SKU' => array('title' => $this->l('Which SKU field to use '), 'validation' => 'isInt', 'type' => 'select', 'identifier' => 'key', 'list' => array(array('key' => Powatag::EAN, 'name' => $this->l('EAN13 or JAN')), array('key' => Powatag::UPC, 'name' => $this->l('UPC')), array('key' => Powatag::PRODUCT_ID, 'name' => $this->l('Product ID')), array('key' => Powatag::REFERENCE, 'name' => $this->l('REFERENCE')))), 'POWATAG_REDIRECT' => array('title' => $this->l('URL Redirect'), 'validation' => 'isString', 'type' => 'text', 'size' => 250), 'POWATAG_OFFER' => array('title' => $this->l('Promotional area'), 'validation' => 'isString', 'type' => 'text', 'size' => 250), 'POWATAG_LANG' => array('title' => $this->l('Language'), 'validation' => 'isString', 'type' => 'select', 'identifier' => 'key', 'list' => array(array('key' => '', 'name' => $this->l('Default')), array('key' => 'site', 'name' => $this->l('Use site language')), array('key' => 'en_GB', 'name' => $this->l('en_GB')), array('key' => 'es_ES', 'name' => $this->l('es_ES')), array('key' => 'fr_FR', 'name' => $this->l('fr_FR')), array('key' => 'it_IT', 'name' => $this->l('it_IT')))), 'POWATAG_TYPE' => array('title' => $this->l('Type'), 'validation' => 'isString', 'type' => 'select', 'identifier' => 'key', 'list' => array(array('key' => '', 'name' => $this->l('Default')), array('key' => 'bag', 'name' => $this->l('Bag')), array('key' => 'mobile-button', 'name' => $this->l('Mobile button')), array('key' => 'tablet-bag', 'name' => $this->l('Tablet bag')))), 'POWATAG_STYLE' => array('title' => $this->l('Style'), 'validation' => 'isString', 'type' => 'select', 'identifier' => 'key', 'list' => array(array('key' => '', 'name' => $this->l('Default')), array('key' => 'act-left', 'name' => $this->l('act-left')), array('key' => 'act-right', 'name' => $this->l('act-right')), array('key' => 'buy-left', 'name' => $this->l('buy-left')), array('key' => 'buy-right', 'name' => $this->l('buy-right')), array('key' => 'give-left', 'name' => $this->l('give-left')), array('key' => 'give-right', 'name' => $this->l('give-right')), array('key' => 'bg-act-left', 'name' => $this->l('bg-act-left')), array('key' => 'bg-act-right', 'name' => $this->l('bg-act-right')), array('key' => 'bg-buy-left', 'name' => $this->l('bg-buy-left')), array('key' => 'bg-buy-right', 'name' => $this->l('bg-buy-right')), array('key' => 'bg-give-left', 'name' => $this->l('bg-give-left')), array('key' => 'bg-give-right', 'name' => $this->l('bg-give-right')))), 'POWATAG_COLORSCHEME' => array('title' => $this->l('Color scheme'), 'validation' => 'isString', 'type' => 'select', 'identifier' => 'key', 'list' => array(array('key' => '', 'name' => $this->l('Default')), array('key' => 'light', 'name' => $this->l('Light')), array('key' => 'dark', 'name' => $this->l('Dark')))), 'POWATAG_DISPLAY' => array('title' => $this->l('Desktop / mobile'), 'validation' => 'isString', 'type' => 'select', 'identifier' => 'key', 'list' => array(array('key' => '', 'name' => $this->l('Default')), array('key' => 'both', 'name' => $this->l('Both')), array('key' => 'desktop-only', 'name' => $this->l('Desktop only')), array('key' => 'mobile-only', 'name' => $this->l('Mobile only')))), 'POWATAG_VIDEO' => array('title' => $this->l('Video'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool'), 'POWATAG_DEBUG' => array('title' => $this->l('Developer mode'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool')), 'submit' => array('title' => $this->l('Save'))), 'logs' => array('title' => $this->l('Logs'), 'image' => '../img/t/AdminLogs.gif', 'fields' => array('POWATAG_API_LOG' => array('title' => $this->l('Enable applicative logging'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool', 'visibility' => Shop::CONTEXT_SHOP), 'POWATAG_REQUEST_LOG' => array('title' => $this->l('Enable request logging'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool', 'visibility' => Shop::CONTEXT_SHOP)), 'submit' => array('title' => $this->l('Save'))));
}
示例9: getContent
function getContent()
{
// make url
$url_vars = array('id_tab' => '13', 'section' => 'advanced_parameters');
if (version_compare(_PS_VERSION_, '1.5', '>')) {
$url_vars['controller'] = Tools::getValue('controller');
} else {
$url_vars['tab'] = Tools::getValue('tab');
}
$url = $this->_getUrl($url_vars);
$smarty_vars = array('url' => $url, 'sizes' => ImageType::getImagesTypes('products'), 'sizedefault' => $this->ebay_profile->getConfiguration('EBAY_PICTURE_SIZE_DEFAULT'), 'sizebig' => (int) $this->ebay_profile->getConfiguration('EBAY_PICTURE_SIZE_BIG'), 'sizesmall' => (int) $this->ebay_profile->getConfiguration('EBAY_PICTURE_SIZE_SMALL'), 'picture_per_listing' => (int) $this->ebay_profile->getConfiguration('EBAY_PICTURE_PER_LISTING'), 'api_logs' => Configuration::get('EBAY_API_LOGS'), 'activate_logs' => Configuration::get('EBAY_ACTIVATE_LOGS'), 'is_writable' => is_writable(_PS_MODULE_DIR_ . 'ebay/log/request.txt'), 'log_file_exists' => file_exists(_PS_MODULE_DIR_ . 'ebay/log/request.txt'), 'logs_conservation_duration' => Configuration::get('EBAY_LOGS_DAYS'), 'sync_products_by_cron' => Configuration::get('EBAY_SYNC_PRODUCTS_BY_CRON'), 'sync_products_by_cron_url' => $this->_getModuleUrl() . 'synchronizeProducts_CRON.php', 'sync_products_by_cron_path' => $this->_getModuleUrl() . 'synchronizeProducts_CRON.php', 'sync_orders_by_cron' => Configuration::get('EBAY_SYNC_ORDERS_BY_CRON'), 'sync_orders_by_cron_url' => $this->_getModuleUrl() . 'synchronizeOrders_CRON.php', 'sync_orders_by_cron_path' => $this->_getModuleUrl() . 'synchronizeOrders_CRON.php', 'orders_days_backward' => Configuration::get('EBAY_ORDERS_DAYS_BACKWARD'), 'stats' => Configuration::get('EBAY_SEND_STATS'));
return $this->display('formAdvancedParameters.tpl', $smarty_vars);
}
示例10: afterImageUpload
// );
return parent::renderForm();
}
protected function afterImageUpload()
{
$res = true;
/* Generate image with differents size */
if (($id_friend_data = (int) Tools::getValue('id_friend_data')) && isset($_FILES) && isset($_FILES) && count($_FILES) && $_FILES['image']['name'] != null && file_exists(_PS_MYFRIENDS_IMG_DIR_ . $id_friend_data . '.jpg')) {
$images_types = ImageType::getImagesTypes('products');
foreach ($images_types as $k => $image_type) {
$res &= ImageManager::resize(_PS_MYFRIENDS_IMG_DIR_ . $id_friend_data . '.jpg', _PS_MYFRIENDS_IMG_DIR_ . $id_friend_data . '-' . stripslashes($image_type['name']) . '.jpg', (int) $image_type['width'], (int) $image_type['height']);
}
}
if (!$res) {
$this->errors[] = Tools::displayError('Unable to resize one or more of your pictures.');
示例11: process
public function process()
{
parent::process();
if (!($id_category = (int) Tools::getValue('id_category')) or !Validate::isUnsignedId($id_category)) {
$this->errors[] = Tools::displayError('Missing category ID');
} else {
if (!Validate::isLoadedObject($this->category)) {
$this->errors[] = Tools::displayError('Category does not exist');
} elseif (!$this->category->checkAccess((int) self::$cookie->id_customer)) {
$this->errors[] = Tools::displayError('You do not have access to this category.');
} elseif (!$this->category->active) {
self::$smarty->assign('category', $this->category);
} else {
$rewrited_url = self::$link->getCategoryLink((int) $this->category->id, $this->category->link_rewrite);
/* Scenes (could be externalised to another controler if you need them */
self::$smarty->assign('scenes', Scene::getScenes((int) $this->category->id, (int) self::$cookie->id_lang, true, false));
/* Scenes images formats */
if ($sceneImageTypes = ImageType::getImagesTypes('scenes')) {
foreach ($sceneImageTypes as $sceneImageType) {
if ($sceneImageType['name'] == 'thumb_scene') {
$thumbSceneImageType = $sceneImageType;
} elseif ($sceneImageType['name'] == 'large_scene') {
$largeSceneImageType = $sceneImageType;
}
}
self::$smarty->assign('thumbSceneImageType', isset($thumbSceneImageType) ? $thumbSceneImageType : NULL);
self::$smarty->assign('largeSceneImageType', isset($largeSceneImageType) ? $largeSceneImageType : NULL);
}
$this->category->description = nl2br2($this->category->description);
$subCategories = $this->category->getSubCategories((int) self::$cookie->id_lang);
self::$smarty->assign('category', $this->category);
if (isset($subCategories) and !empty($subCategories) and $subCategories) {
self::$smarty->assign('subcategories', $subCategories);
self::$smarty->assign(array('subcategories_nb_total' => sizeof($subCategories), 'subcategories_nb_half' => ceil(sizeof($subCategories) / 2)));
}
if ($this->category->id != 1) {
$this->productListAssign();
}
self::$smarty->assign(array('products' => (isset($this->cat_products) and $this->cat_products) ? $this->cat_products : NULL, 'id_category' => (int) $this->category->id, 'id_category_parent' => (int) $this->category->id_parent, 'return_category_name' => Tools::safeOutput($this->category->name), 'path' => Tools::getPath((int) $this->category->id), 'add_prod_display' => Configuration::get('PS_ATTRIBUTE_CATEGORY_DISPLAY'), 'categorySize' => Image::getSize('category'), 'mediumSize' => Image::getSize('medium'), 'thumbSceneSize' => Image::getSize('thumb_scene'), 'homeSize' => Image::getSize('home')));
if (isset(self::$cookie->id_customer)) {
self::$smarty->assign('compareProducts', CompareProduct::getCustomerCompareProducts((int) self::$cookie->id_customer));
} elseif (isset(self::$cookie->id_guest)) {
self::$smarty->assign('compareProducts', CompareProduct::getGuestCompareProducts((int) self::$cookie->id_guest));
}
}
}
self::$smarty->assign(array('allow_oosp' => (int) Configuration::get('PS_ORDER_OUT_OF_STOCK'), 'comparator_max_item' => (int) Configuration::get('PS_COMPARATOR_MAX_ITEM'), 'suppliers' => Supplier::getSuppliers()));
}
示例12: renderForm
public function renderForm($args, $data)
{
$helper = $this->getFormHelper();
$imagesTypes = ImageType::getImagesTypes('manufacturers');
$this->fields_form[1]['form'] = array('legend' => array('title' => $this->l('Widget Form.')), 'input' => array(array('type' => 'select', 'label' => $this->l('Image'), 'desc' => $this->l('Select type image for manufacture.'), 'name' => 'image', 'default' => 'small' . '_default', 'options' => array('query' => $imagesTypes, 'id' => 'name', 'name' => 'name')), array('type' => 'text', 'label' => $this->l('Limit'), 'name' => 'itemstab', 'default' => 6, 'desc' => $this->l('The maximum number of products in each Carousel (default: 6).')), array('type' => 'select', 'label' => $this->l('Carousel type'), 'name' => 'carousel_type', 'default' => LeomanagewidgetsOwlCarousel::CAROUSEL_BOOTSTRAP, 'class' => 'form-action', 'options' => array('query' => LeomanagewidgetsOwlCarousel::getCaroulseOptions(), 'id' => 'value', 'name' => 'name')), array('type' => 'text', 'label' => $this->l('Items Per Page'), 'name' => 'itemspage', 'default' => 3, 'form_group_class' => 'carousel_type_sub carousel_type-' . LeomanagewidgetsOwlCarousel::CAROUSEL_BOOTSTRAP, 'desc' => $this->l('The maximum number of products in each page Carousel (default: 3).')), array('type' => 'text', 'label' => $this->l('Colums In Tab'), 'name' => 'columns', 'default' => 3, 'form_group_class' => 'carousel_type_sub carousel_type-' . LeomanagewidgetsOwlCarousel::CAROUSEL_BOOTSTRAP, 'desc' => 'The maximum column products in each page Carousel (default: 3).'), array('type' => 'text', 'label' => $this->l('Interval'), 'name' => 'interval', 'default' => 8000, 'form_group_class' => 'carousel_type_sub carousel_type-' . LeomanagewidgetsOwlCarousel::CAROUSEL_BOOTSTRAP, 'desc' => $this->l('Enter Time(miniseconds) to play carousel. Value 0 to stop.'))), 'buttons' => array(array('title' => $this->l('Save And Stay'), 'icon' => 'process-icon-save', 'class' => 'pull-right', 'type' => 'submit', 'name' => 'saveandstayleotempcp'), array('title' => $this->l('Save'), 'icon' => 'process-icon-save', 'class' => 'pull-right', 'type' => 'submit', 'name' => 'saveleotempcp')));
// Add library owl carousel
$owl_carousel = new LeomanagewidgetsOwlCarousel();
$arrays = $owl_carousel->getOwlCarouselAdminFormOptions();
foreach ($arrays as $array) {
# validate module
$this->fields_form[1]['form']['input'][] = $array;
}
$default_lang = (int) Configuration::get('PS_LANG_DEFAULT');
$helper->tpl_vars = array('fields_value' => $this->getConfigFieldsValues($data), 'languages' => Context::getContext()->controller->getLanguages(), 'id_language' => $default_lang);
unset($args);
return $helper->generateForm($this->fields_form);
}
示例13: getImages
/**
* 獲取產品圖片
*/
public function getImages()
{
$result = Db::getInstance()->getAll('
SELECT *
FROM `' . DB_PREFIX . 'product_to_image`
WHERE `id_product` = ' . (int) $this->id . ' ORDER BY position ASC');
if ($result == false) {
return false;
}
$imageType = ImageType::getImagesTypes(ImageType::IMAGE_PRDOCUT);
foreach ($result as &$row) {
foreach ($imageType as $type) {
$row[$type['name']] = Image::getImageLink($row['id_image'], $type['name']);
}
}
return $result;
}
示例14: displayForm
public function displayForm($isMainTab = true)
{
global $currentIndex, $cookie;
parent::displayForm();
$imagesTypes = ImageType::getImagesTypes();
$imageObj = new Image(Tools::getValue('id_image'));
echo '
<script type="text/javascript" src="../js/cropper/prototype.js"></script>
<script type="text/javascript" src="../js/cropper/scriptaculous.js"></script>
<script type="text/javascript" src="../js/cropper/builder.js"></script>
<script type="text/javascript" src="../js/cropper/dragdrop.js"></script>
<script type="text/javascript" src="../js/cropper/cropper.js"></script>
<script type="text/javascript" src="../js/cropper/loader.js"></script>
<form enctype="multipart/form-data" method="post" action="' . $currentIndex . '&imageresize&token=' . Tools::getAdminToken('AdminCatalog' . (int) Tab::getIdFromClassName('AdminCatalog') . (int) $cookie->id_employee) . '">
<input type="hidden" name="id_product" value="' . Tools::getValue('id_product') . '" />
<input type="hidden" name="id_category" value="' . Tools::getValue('id_category') . '" />
<input type="hidden" name="saveandstay" value="' . Tools::getValue('submitAddAndStay') . '" />
<input type="hidden" name="conf" value="' . Tools::getValue('toconf') . '" />
<input type="hidden" name="imageresize" value="imageresize" />
<input type="hidden" name="id_image" value="' . Tools::getValue('id_image') . '" />
<fieldset>
<legend><img src="../img/admin/picture.gif" />' . $this->l('Image resize') . '</legend>
' . $this->l('Using your mouse, define which area of the image is to be used for generating each type of thumbnail.') . '
<br /><br />
<img src="' . _THEME_PROD_DIR_ . $imageObj->getExistingImgPath() . '.jpg" id="testImage">
<label for="imageChoice">' . $this->l('Thumbnails format') . '</label>
<div class="margin-form"">
<select name="imageChoice" id="imageChoice">';
foreach ($imagesTypes as $type) {
echo '<option value="../img/p/' . $imageObj->getExistingImgPath() . '.jpg|' . $type['width'] . '|' . $type['height'] . '|' . $type['id_image_type'] . '">' . $type['name'] . '</option>';
}
echo ' </select>
<input type="submit" class="button" style="margin-left : 40px;" name="resize" value="' . $this->l(' Save all ') . '" />
</div>';
foreach ($imagesTypes as $type) {
echo '
<input type="hidden" name="' . $type['id_image_type'] . '_x1" id="' . $type['id_image_type'] . '_x1" value="0" />
<input type="hidden" name="' . $type['id_image_type'] . '_y1" id="' . $type['id_image_type'] . '_y1" value="0" />
<input type="hidden" name="' . $type['id_image_type'] . '_x2" id="' . $type['id_image_type'] . '_x2" value="0" />
<input type="hidden" name="' . $type['id_image_type'] . '_y2" id="' . $type['id_image_type'] . '_y2" value="0" />';
}
echo ' </fieldset>
</form>';
}
示例15: deleteNoPictureImages
private function deleteNoPictureImages($id_language)
{
$language = Language::getIsoById($id_language);
$imagesTypes = ImageType::getImagesTypes('products');
$dirs = array(_PS_PROD_IMG_DIR_, _PS_CAT_IMG_DIR_, _PS_MANU_IMG_DIR_);
foreach ($dirs as $dir) {
foreach ($imagesTypes as $k => $imageType) {
if (file_exists($dir . $language . '-default-' . stripslashes($imageType['name']) . '.jpg')) {
if (!unlink($dir . $language . '-default-' . stripslashes($imageType['name']) . '.jpg')) {
$this->_errors[] = Tools::displayError('an error occurred during the image deletion');
}
}
}
if (file_exists($dir . $language . '.jpg')) {
if (!unlink($dir . $language . '.jpg')) {
$this->_errors[] = Tools::displayError('an error occurred during the image deletion');
}
}
}
return !sizeof($this->_errors) ? true : false;
}