diff --git a/.gitignore b/.gitignore index 4eab9b4..5ab3b55 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +/.idea /.settings /.externalToolBuilders /.project diff --git a/modman b/modman index a7e11a3..22fb9d2 100644 --- a/modman +++ b/modman @@ -1,7 +1,9 @@ src/app/code/community/Flagbit/Faq app/code/community/Flagbit/Faq +src/app/design/adminhtml/default/default/layout/faq.xml app/design/adminhtml/default/default/layout/faq.xml src/app/design/frontend/base/default/layout/faq.xml app/design/frontend/base/default/layout/faq.xml src/app/design/frontend/base/default/template/faq app/design/frontend/base/default/template/faq src/app/etc/modules/Flagbit_Faq.xml app/etc/modules/Flagbit_Faq.xml src/app/locale/de_DE/Flagbit_Faq.csv app/locale/de_DE/Flagbit_Faq.csv +src/app/locale/fr_FR/Flagbit_Faq.csv app/locale/fr_FR/Flagbit_Faq.csv src/app/locale/nl_NL/Flagbit_Faq.csv app/locale/nl_NL/Flagbit_Faq.csv src/app/locale/ru_RU/Flagbit_Faq.csv app/locale/ru_RU/Flagbit_Faq.csv \ No newline at end of file diff --git a/src/app/code/community/Flagbit/Faq/Block/Adminhtml/Category/Edit/Tab/Main.php b/src/app/code/community/Flagbit/Faq/Block/Adminhtml/Category/Edit/Tab/Main.php index 7944fe9..00a30f7 100644 --- a/src/app/code/community/Flagbit/Faq/Block/Adminhtml/Category/Edit/Tab/Main.php +++ b/src/app/code/community/Flagbit/Faq/Block/Adminhtml/Category/Edit/Tab/Main.php @@ -25,7 +25,7 @@ protected function _prepareForm() { $model = Mage::registry('faq_category'); - $form = new Varien_Data_Form(); + $form = new Varien_Data_Form(array('enctype' => 'multipart/form-data')); $form->setHtmlIdPrefix('faq_'); $fieldset = $form->addFieldset('base_fieldset', array ( @@ -44,7 +44,13 @@ protected function _prepareForm() 'title' => Mage::helper('flagbit_faq')->__('Category Name'), 'required' => true, )); - + + $fieldset->addField('icon', 'image', array( + 'label' => Mage::helper('flagbit_faq')->__('Icon'), + 'required' => false, + 'name' => 'icon', + )); + /** * Check is single store mode */ @@ -63,6 +69,13 @@ protected function _prepareForm() 'value' => Mage::app()->getStore(true)->getId() )); $model->setStoreId(Mage::app()->getStore(true)->getId()); } + + $fieldset->addField('position', 'text', + array ( + 'label' => Mage::helper('flagbit_faq')->__('position'), + 'title' => Mage::helper('flagbit_faq')->__('position'), + 'name' => 'position', + 'required' => true)); $fieldset->addField('is_active', 'select', array ( diff --git a/src/app/code/community/Flagbit/Faq/Block/Adminhtml/Category/Grid.php b/src/app/code/community/Flagbit/Faq/Block/Adminhtml/Category/Grid.php index 655264e..af08a01 100644 --- a/src/app/code/community/Flagbit/Faq/Block/Adminhtml/Category/Grid.php +++ b/src/app/code/community/Flagbit/Faq/Block/Adminhtml/Category/Grid.php @@ -37,7 +37,7 @@ public function __construct() */ protected function _prepareCollection() { - $collection = Mage::getResourceModel('flagbit_faq/category_collection'); + $collection = Mage::getResourceModel('flagbit_faq/category_collection')->setOrder('position','ASC'); $this->setCollection($collection); return parent::_prepareCollection(); } @@ -54,7 +54,24 @@ protected function _prepareColumns() 'width' => '80px', 'type' => 'text', 'index' => 'category_id' )); - + + $this->addColumn('position', array ( + 'header' => Mage::helper('flagbit_faq')->__('position'), + 'width' => '20px', + 'type' => 'text', + 'index' => 'position' )); + + $this->addColumn( + 'icon', + array( + 'header' => Mage::helper('flagbit_faq')->__('Icon'), + 'index' => 'icon', + 'width' => '50px', + 'renderer' => 'Flagbit_Faq_Block_Widget_Grid_Column_Renderer_Media', + 'filter' => false + ) + ); + $this->addColumn( 'category_name', array( diff --git a/src/app/code/community/Flagbit/Faq/Block/Adminhtml/Item/Edit/Tab/Main.php b/src/app/code/community/Flagbit/Faq/Block/Adminhtml/Item/Edit/Tab/Main.php index d5315a9..1ff7bd9 100644 --- a/src/app/code/community/Flagbit/Faq/Block/Adminhtml/Item/Edit/Tab/Main.php +++ b/src/app/code/community/Flagbit/Faq/Block/Adminhtml/Item/Edit/Tab/Main.php @@ -1,125 +1,132 @@ - - */ - -/** - * FAQ for Magento - * - * @category Flagbit - * @package Flagbit_Faq - * @author Flagbit GmbH & Co. KG - */ -class Flagbit_Faq_Block_Adminhtml_Item_Edit_Tab_Main extends Mage_Adminhtml_Block_Widget_Form -{ - /** - * Prepares the page layout - * - * Loads the WYSIWYG editor on demand if enabled. - * - * @return Flagbit_Faq_Block_Admin_Edit - */ - protected function _prepareLayout() - { - $return = parent::_prepareLayout(); - if (Mage::getSingleton('cms/wysiwyg_config')->isEnabled()) { - $this->getLayout()->getBlock('head')->setCanLoadTinyMce(true); - } - return $return; - } - - /** - * Preparation of current form - * - * @return Flagbit_Faq_Block_Admin_Edit_Tab_Main Self - */ - protected function _prepareForm() - { - $model = Mage::registry('faq'); - - $form = new Varien_Data_Form(); - $form->setHtmlIdPrefix('faq_'); - - $fieldset = $form->addFieldset('base_fieldset', array ( - 'legend' => Mage::helper('flagbit_faq')->__('General information'), - 'class' => 'fieldset-wide' )); - - if ($model->getFaqId()) { - $fieldset->addField('faq_id', 'hidden', array ( - 'name' => 'faq_id' )); - } - - $fieldset->addField('question', 'text', array ( - 'name' => 'question', - 'label' => Mage::helper('flagbit_faq')->__('FAQ item question'), - 'title' => Mage::helper('flagbit_faq')->__('FAQ item question'), - 'required' => true )); - - /** - * Check is single store mode - */ - if (!Mage::app()->isSingleStoreMode()) { - $fieldset->addField('store_id', 'multiselect', - array ( - 'name' => 'stores[]', - 'label' => Mage::helper('cms')->__('Store view'), - 'title' => Mage::helper('cms')->__('Store view'), - 'required' => true, - 'values' => Mage::getSingleton('adminhtml/system_store')->getStoreValuesForForm(false, true) )); - } - else { - $fieldset->addField('store_id', 'hidden', array ( - 'name' => 'stores[]', - 'value' => Mage::app()->getStore(true)->getId() )); - $model->setStoreId(Mage::app()->getStore(true)->getId()); - } - - $fieldset->addField('is_active', 'select', - array ( - 'label' => Mage::helper('cms')->__('Status'), - 'title' => Mage::helper('flagbit_faq')->__('Item status'), - 'name' => 'is_active', - 'required' => true, - 'options' => array ( - '1' => Mage::helper('cms')->__('Enabled'), - '0' => Mage::helper('cms')->__('Disabled') ) )); - - $fieldset->addField('category_id', 'multiselect', - array ( - 'label' => Mage::helper('flagbit_faq')->__('Category'), - 'title' => Mage::helper('flagbit_faq')->__('Category'), - 'name' => 'categories[]', - 'required' => false, - 'values' => Mage::getResourceSingleton('flagbit_faq/category_collection')->toOptionArray(), - ) - ); - - $fieldset->addField('answer', 'editor', - array ( - 'name' => 'answer', - 'label' => Mage::helper('flagbit_faq')->__('Content'), - 'title' => Mage::helper('flagbit_faq')->__('Content'), - 'style' => 'height:36em;', - 'config' => Mage::getSingleton('cms/wysiwyg_config')->getConfig(), - 'required' => true )); - - $fieldset->addField('answer_html', 'select', - array ( - 'label' => Mage::helper('flagbit_faq')->__('HTML answer'), - 'title' => Mage::helper('flagbit_faq')->__('HTML answer'), - 'name' => 'answer_html', - 'required' => true, - 'options' => array ( - '1' => Mage::helper('cms')->__('Enabled'), - '0' => Mage::helper('cms')->__('Disabled') ) )); - - $form->setValues($model->getData()); - $this->setForm($form); - - return parent::_prepareForm(); - } -} + + */ + +/** + * FAQ for Magento + * + * @category Flagbit + * @package Flagbit_Faq + * @author Flagbit GmbH & Co. KG + */ +class Flagbit_Faq_Block_Adminhtml_Item_Edit_Tab_Main extends Mage_Adminhtml_Block_Widget_Form +{ + /** + * Prepares the page layout + * + * Loads the WYSIWYG editor on demand if enabled. + * + * @return Flagbit_Faq_Block_Admin_Edit + */ + protected function _prepareLayout() + { + $return = parent::_prepareLayout(); + if (Mage::getSingleton('cms/wysiwyg_config')->isEnabled()) { + $this->getLayout()->getBlock('head')->setCanLoadTinyMce(true); + } + return $return; + } + + /** + * Preparation of current form + * + * @return Flagbit_Faq_Block_Admin_Edit_Tab_Main Self + */ + protected function _prepareForm() + { + $model = Mage::registry('faq'); + + $form = new Varien_Data_Form(); + $form->setHtmlIdPrefix('faq_'); + + $fieldset = $form->addFieldset('base_fieldset', array ( + 'legend' => Mage::helper('flagbit_faq')->__('General information'), + 'class' => 'fieldset-wide' )); + + if ($model->getFaqId()) { + $fieldset->addField('faq_id', 'hidden', array ( + 'name' => 'faq_id' )); + } + + $fieldset->addField('question', 'text', array ( + 'name' => 'question', + 'label' => Mage::helper('flagbit_faq')->__('FAQ item question'), + 'title' => Mage::helper('flagbit_faq')->__('FAQ item question'), + 'required' => true )); + + /** + * Check is single store mode + */ + if (!Mage::app()->isSingleStoreMode()) { + $fieldset->addField('store_id', 'multiselect', + array ( + 'name' => 'stores[]', + 'label' => Mage::helper('cms')->__('Store view'), + 'title' => Mage::helper('cms')->__('Store view'), + 'required' => true, + 'values' => Mage::getSingleton('adminhtml/system_store')->getStoreValuesForForm(false, true) )); + } + else { + $fieldset->addField('store_id', 'hidden', array ( + 'name' => 'stores[]', + 'value' => Mage::app()->getStore(true)->getId() )); + $model->setStoreId(Mage::app()->getStore(true)->getId()); + } + + $fieldset->addField('position', 'text', + array ( + 'label' => Mage::helper('flagbit_faq')->__('position'), + 'title' => Mage::helper('flagbit_faq')->__('position'), + 'name' => 'position', + 'required' => true)); + + $fieldset->addField('is_active', 'select', + array ( + 'label' => Mage::helper('cms')->__('Status'), + 'title' => Mage::helper('flagbit_faq')->__('Item status'), + 'name' => 'is_active', + 'required' => true, + 'options' => array ( + '1' => Mage::helper('cms')->__('Enabled'), + '0' => Mage::helper('cms')->__('Disabled') ) )); + + $fieldset->addField('category_id', 'multiselect', + array ( + 'label' => Mage::helper('flagbit_faq')->__('Category'), + 'title' => Mage::helper('flagbit_faq')->__('Category'), + 'name' => 'categories[]', + 'required' => false, + 'values' => Mage::getResourceSingleton('flagbit_faq/category_collection')->toOptionArray(), + ) + ); + + $fieldset->addField('answer', 'editor', + array ( + 'name' => 'answer', + 'label' => Mage::helper('flagbit_faq')->__('Content'), + 'title' => Mage::helper('flagbit_faq')->__('Content'), + 'style' => 'height:36em;', + 'config' => Mage::getSingleton('cms/wysiwyg_config')->getConfig(), + 'required' => true )); + + $fieldset->addField('answer_html', 'select', + array ( + 'label' => Mage::helper('flagbit_faq')->__('HTML answer'), + 'title' => Mage::helper('flagbit_faq')->__('HTML answer'), + 'name' => 'answer_html', + 'required' => true, + 'options' => array ( + '1' => Mage::helper('cms')->__('Enabled'), + '0' => Mage::helper('cms')->__('Disabled') ) )); + + $form->setValues($model->getData()); + $this->setForm($form); + + return parent::_prepareForm(); + } +} diff --git a/src/app/code/community/Flagbit/Faq/Block/Adminhtml/Item/Grid.php b/src/app/code/community/Flagbit/Faq/Block/Adminhtml/Item/Grid.php index bf11f68..c645511 100644 --- a/src/app/code/community/Flagbit/Faq/Block/Adminhtml/Item/Grid.php +++ b/src/app/code/community/Flagbit/Faq/Block/Adminhtml/Item/Grid.php @@ -1,155 +1,206 @@ - - */ - -/** - * FAQ for Magento - * - * @category Flagbit - * @package Flagbit_Faq - * @author Flagbit GmbH & Co. KG - */ -class Flagbit_Faq_Block_Adminhtml_Item_Grid extends Mage_Adminhtml_Block_Widget_Grid -{ - /** - * Constructor of Grid - * - */ - public function __construct() - { - parent::__construct(); - $this->setId('faq_grid'); - $this->setUseAjax(false); - $this->setDefaultSort('creation_time'); - $this->setDefaultDir('DESC'); - $this->setSaveParametersInSession(true); - } - - /** - * Preparation of the data that is displayed by the grid. - * - * @return Flagbit_Faq_Block_Admin_Grid Self - */ - protected function _prepareCollection() - { - //TODO: add full name logic - $collection = Mage::getResourceModel('flagbit_faq/faq_collection'); - $this->setCollection($collection); - #Mage::Log($collection->getData()); - return parent::_prepareCollection(); - } - - /** - * Preparation of the requested columns of the grid - * - * @return Flagbit_Faq_Block_Admin_Grid Self - */ - protected function _prepareColumns() - { - $this->addColumn('faq_id', array ( - 'header' => Mage::helper('flagbit_faq')->__('FAQ #'), - 'width' => '80px', - 'type' => 'text', - 'index' => 'faq_id' )); - - $this->addColumn('question', array ( - 'header' => Mage::helper('flagbit_faq')->__('Question'), - 'index' => 'question' )); - - if (!Mage::app()->isSingleStoreMode()) { - $this->addColumn('store_id', - array ( - 'header' => Mage::helper('cms')->__('Store view'), - 'index' => 'store_id', - 'type' => 'store', - 'store_all' => true, - 'store_view' => true, - 'sortable' => false, - 'filter_condition_callback' => array ( - $this, - '_filterStoreCondition' ) )); - } - - $this->addColumn('is_active', - array ( - 'header' => Mage::helper('flagbit_faq')->__('Active'), - 'index' => 'is_active', - 'type' => 'options', - 'width' => '70px', - 'options' => array ( - 0 => Mage::helper('flagbit_faq')->__('No'), - 1 => Mage::helper('flagbit_faq')->__('Yes') ) )); - - $this->addColumn('action', - array ( - 'header' => Mage::helper('flagbit_faq')->__('Action'), - 'width' => '50px', - 'type' => 'action', - 'getter' => 'getId', - 'actions' => array ( - array ( - 'caption' => Mage::helper('flagbit_faq')->__('Edit'), - 'url' => array ( - 'base' => 'adminhtml/faq/edit' ), - 'field' => 'faq_id' ) ), - 'filter' => false, - 'sortable' => false, - 'index' => 'stores', - 'is_system' => true )); - - return parent::_prepareColumns(); - } - - /** - * Helper function to do after load modifications - * - */ - protected function _afterLoadCollection() - { - $this->getCollection()->walk('afterLoad'); - parent::_afterLoadCollection(); - } - - /** - * Helper function to add store filter condition - * - * @param Mage_Core_Model_Mysql4_Collection_Abstract $collection Data collection - * @param Mage_Adminhtml_Block_Widget_Grid_Column $column Column information to be filtered - */ - protected function _filterStoreCondition($collection, $column) - { - if (!$value = $column->getFilter()->getValue()) { - return; - } - - $this->getCollection()->addStoreFilter($value); - } - - /** - * Helper function to reveive on row click url - * - * @param Flagbit_Faq_Model_Faq $row Current rows dataset - * @return string URL for current row's onclick event - */ - public function getRowUrl($row) - { - return $this->getUrl('adminhtml/faq/edit', array ( - 'faq_id' => $row->getFaqId() )); - } - - /** - * Helper function to receive grid functionality urls for current grid - * - * @return string Requested URL - */ - public function getGridUrl() - { - return $this->getUrl('adminhtml/faq/index', array ( - '_current' => true )); - } -} + + */ + +/** + * FAQ for Magento + * + * @category Flagbit + * @package Flagbit_Faq + * @author Flagbit GmbH & Co. KG + */ +class Flagbit_Faq_Block_Adminhtml_Item_Grid extends Mage_Adminhtml_Block_Widget_Grid +{ + + private $_categories = null; + + /** + * Constructor of Grid + * + */ + public function __construct() + { + parent::__construct(); + $this->setId('faq_grid'); + $this->setUseAjax(false); + $this->setDefaultSort('creation_time'); + $this->setDefaultDir('DESC'); + $this->setSaveParametersInSession(true); + } + + /** + * Preparation of the data that is displayed by the grid. + * + * @return Flagbit_Faq_Block_Admin_Grid Self + */ + protected function _prepareCollection() + { + //TODO: add full name logic + $collection = Mage::getResourceModel('flagbit_faq/faq_collection'); + $this->setCollection($collection); + #Mage::Log($collection->getData()); + return parent::_prepareCollection(); + } + + protected function getCategories() + { + if (!$this->_categories){ + $this->_categories = array(); + $collection = Mage::getResourceModel('flagbit_faq/category_collection')->setOrder('category_name','ASC'); + /** @var Flagbit_Faq_Model_Category $category */ + foreach ($collection as $category){ + $this->_categories[$category->getId()] = $category->getCategoryName(); + } + } + return $this->_categories; + } + + /** + * Preparation of the requested columns of the grid + * + * @return Flagbit_Faq_Block_Admin_Grid Self + */ + protected function _prepareColumns() + { + $this->addColumn('faq_id', array ( + 'header' => Mage::helper('flagbit_faq')->__('FAQ #'), + 'width' => '80px', + 'type' => 'text', + 'index' => 'faq_id' )); + + $this->addColumn('position', array ( + 'header' => Mage::helper('flagbit_faq')->__('position'), + 'width' => '20px', + 'type' => 'text', + 'index' => 'position' )); + + + $this->addColumn('categories', + array( + 'header' => Mage::helper('flagbit_faq')->__('Categories'), + 'index' => 'category', + 'width' => '250px', + 'type' => 'options', + 'renderer' => 'Flagbit_Faq_Block_Adminhtml_Renderer_Categories', + 'options' => $this->getCategories(), + 'filter_condition_callback' + => array($this, '_filterCategoriesCondition'), + )); + + $this->addColumn('question', array ( + 'header' => Mage::helper('flagbit_faq')->__('Question'), + 'index' => 'question' )); + + if (!Mage::app()->isSingleStoreMode()) { + $this->addColumn('store_id', + array ( + 'header' => Mage::helper('cms')->__('Store view'), + 'index' => 'store_id', + 'type' => 'store', + 'store_all' => true, + 'store_view' => true, + 'sortable' => false, + 'filter_condition_callback' => array ( + $this, + '_filterStoreCondition' ) )); + } + + $this->addColumn('is_active', + array ( + 'header' => Mage::helper('flagbit_faq')->__('Active'), + 'index' => 'is_active', + 'type' => 'options', + 'width' => '70px', + 'options' => array ( + 0 => Mage::helper('flagbit_faq')->__('No'), + 1 => Mage::helper('flagbit_faq')->__('Yes') ) )); + + $this->addColumn('action', + array ( + 'header' => Mage::helper('flagbit_faq')->__('Action'), + 'width' => '50px', + 'type' => 'action', + 'getter' => 'getId', + 'actions' => array ( + array ( + 'caption' => Mage::helper('flagbit_faq')->__('Edit'), + 'url' => array ( + 'base' => 'adminhtml/faq/edit' ), + 'field' => 'faq_id' ) ), + 'filter' => false, + 'sortable' => false, + 'index' => 'stores', + 'is_system' => true )); + + return parent::_prepareColumns(); + } + + /** + * Helper function to do after load modifications + * + */ + protected function _afterLoadCollection() + { + $this->getCollection()->walk('afterLoad'); + parent::_afterLoadCollection(); + } + + protected function _filterCategoriesCondition($collection, $column) + { + if (!$value = $column->getFilter()->getValue()) { + return; + } + + $this->getCollection() + ->getSelect() + ->join( + array('cat_item'=>'faq_category_item'), + 'main_table.faq_id = cat_item.faq_id', + array('cat_item.category_id') + ) + ->where('cat_item.category_id = '.$value); + } + + /** + * Helper function to add store filter condition + * + * @param Mage_Core_Model_Mysql4_Collection_Abstract $collection Data collection + * @param Mage_Adminhtml_Block_Widget_Grid_Column $column Column information to be filtered + */ + protected function _filterStoreCondition($collection, $column) + { + if (!$value = $column->getFilter()->getValue()) { + return; + } + + $this->getCollection()->addStoreFilter($value); + } + + /** + * Helper function to reveive on row click url + * + * @param Flagbit_Faq_Model_Faq $row Current rows dataset + * @return string URL for current row's onclick event + */ + public function getRowUrl($row) + { + return $this->getUrl('adminhtml/faq/edit', array ( + 'faq_id' => $row->getFaqId() )); + } + + /** + * Helper function to receive grid functionality urls for current grid + * + * @return string Requested URL + */ + public function getGridUrl() + { + return $this->getUrl('adminhtml/faq/index', array ( + '_current' => true )); + } +} diff --git a/src/app/code/community/Flagbit/Faq/Block/Adminhtml/Renderer/Categories.php b/src/app/code/community/Flagbit/Faq/Block/Adminhtml/Renderer/Categories.php new file mode 100644 index 0000000..15ca87d --- /dev/null +++ b/src/app/code/community/Flagbit/Faq/Block/Adminhtml/Renderer/Categories.php @@ -0,0 +1,12 @@ +getCategoryId() as $category_id){ + $array[] = Mage::getModel('flagbit_faq/category')->load($category_id)->getCategoryName(); + } + return implode(',',$array); + } +} \ No newline at end of file diff --git a/src/app/code/community/Flagbit/Faq/Block/Frontend/List.php b/src/app/code/community/Flagbit/Faq/Block/Frontend/List.php index 117e3d1..d2aa298 100644 --- a/src/app/code/community/Flagbit/Faq/Block/Frontend/List.php +++ b/src/app/code/community/Flagbit/Faq/Block/Frontend/List.php @@ -1,168 +1,169 @@ - - */ - -/** - * FAQ for Magento - * - * @category Flagbit - * @package Flagbit_Faq - * @author Flagbit GmbH & Co. KG - */ -class Flagbit_Faq_Block_Frontend_List extends Mage_Core_Block_Template -{ - protected $_faqCollection; - - protected function _prepareLayout() - { - if ($head = $this->getLayout()->getBlock('head')) { - $currentTitle = $head->getTitle(); - $currentTitle = str_ireplace(Mage::getStoreConfig('design/head/title_suffix'), '', $currentTitle); - $head->setTitle($this->htmlEscape($this->__('Frequently Asked Questions')) . ' - ' . $currentTitle); - } - } - - /** - * Returns collection of current FAQ entries - * - * @param int $pageSize - * @return Flagbit_Faq_Model_Mysql_Faq_Collection collection of current FAQ entries - */ - public function getFaqCollection($pageSize = null) - { - if (!$this->_faqCollection || (intval($pageSize) > 0 - && $this->_faqCollection->getSize() != intval($pageSize)) - ) { - $this->_faqCollection = Mage :: getModel('flagbit_faq/faq') - ->getCollection() - ->addStoreFilter(Mage :: app()->getStore()) - ->addIsActiveFilter(); - - if (isset($pageSize) && intval($pageSize) && intval($pageSize) > 0) { - $this->_faqCollection->setPageSize(intval($pageSize)); - } - } - - return $this->_faqCollection; - } - - /** - * Returns all active categories - * - * @return Flagbit_Faq_Model_Mysql4_Category_Collection - */ - public function getCategoryCollection() - { - $categories = $this->getData('category_collection'); - if (!is_null($categories)) { - $categories = Mage::getResourceSingleton('flagbit_faq/category_collection') - ->addStoreFilter(Mage::app()->getStore()) - ->addIsActiveFilter(); - $this->setData('category_collection', $categories); - } - return $categories; - } - - /** - * Returns the item collection for the given category - * - * @param Flagbit_Faq_Model_Category $category - * @return Flagbit_Faq_Model_Mysql4_Faq_Collection - */ - public function getItemCollectionByCategory(Flagbit_Faq_Model_Category $category) - { - return $category->getItemCollection()->addIsActiveFilter()->addStoreFilter(Mage::app()->getStore()); - } - - /** - * Simple helper function to determine, whether there are FAQ entries or not. - * - * @return boolean True, if FAQ are given. - */ - public function hasFaq() - { - return $this->getFaqCollection()->getSize() > 0; - } - - public function getIntro($faqItem) - { - $_intro = strip_tags($faqItem->getContent()); - $_intro = mb_substr($_intro, 0, mb_strpos($_intro, "\n")); - - $length = 100 - mb_strlen($faqItem->getQuestion()); - if ($length < 0) { - return ''; - } - if (mb_strlen($_intro) > $length) { - $_intro = mb_substr($_intro, 0, $length); - $_intro = mb_substr($_intro, 0, mb_strrpos($_intro, ' ')).'...'; - } - - return $_intro; - } - - /** - * Returns - * - * @return array - */ - public function getFaqJumplist() - { - if(is_null($this->_faqJumplist)) - { - $this->_faqJumplist = Mage::helper('flagbit_faq/jumplist'); - $this->_faqJumplist->setFaqItems($this->getFaqCollection()); - } - return $this->_faqJumplist; - } - - /** - * Simple helper function to determine, whether we should display a jumplist or not. - * - * @return boolean True if the jumplist should be displayed - */ - public function hasFaqJumplist() { - // TODO add configuration option to enable/disable jumplist - return count($this->getFaqJumplist()) > 0; - } - - /** - * Lists our FAQ items (individual questions) by popularity. This allows you - * to show the most popular questions on the FAQ index page. - * - * @var int Number of items to show per page (SQL LIMIT). - * @var int Number of the page to display, paired with $limit - * @return Flagbit_Faq_Model_Mysql_Faq_Collection collection of current FAQ entries - */ - public function getPopularQuestions($limit = 10, $page = 1) - { - $collection = Mage::getModel('flagbit_faq/faq') - ->getCollection() - ->setPageSize($limit) - ->setCurPage($page); - - // Order by popularity. For more information on why this is necessary - // instead of setOrder() or addAttributeToSort() see http://goo.gl/Jeq3h - $collection->getSelect()->order("popularity DESC"); - - return $collection; - } - - public function encodeQuestionForUrl($question) - { - return urlencode( - trim( - str_replace( - array(' ', 'ä', 'ö', 'ü', 'ß', '.', '/', ';', ':', '=', '?', '__'), - array('_', 'ae', 'oe', 'ue', 'ss', '_', '', '', '', '', '', '_'), - strtolower($question) - ), ' _' - ) - ); - } -} + + */ + +/** + * FAQ for Magento + * + * @category Flagbit + * @package Flagbit_Faq + * @author Flagbit GmbH & Co. KG + */ +class Flagbit_Faq_Block_Frontend_List extends Mage_Core_Block_Template +{ + protected $_faqCollection; + + protected function _prepareLayout() + { + if ($head = $this->getLayout()->getBlock('head')) { + $currentTitle = $head->getTitle(); + $currentTitle = str_ireplace(Mage::getStoreConfig('design/head/title_suffix'), '', $currentTitle); + $head->setTitle($this->htmlEscape($this->__('Frequently Asked Questions')) . ' - ' . $currentTitle); + } + } + + /** + * Returns collection of current FAQ entries + * + * @param int $pageSize + * @return Flagbit_Faq_Model_Mysql_Faq_Collection collection of current FAQ entries + */ + public function getFaqCollection($pageSize = null) + { + if (!$this->_faqCollection || (intval($pageSize) > 0 + && $this->_faqCollection->getSize() != intval($pageSize)) + ) { + $this->_faqCollection = Mage :: getModel('flagbit_faq/faq') + ->getCollection() + ->addStoreFilter(Mage :: app()->getStore()) + ->addIsActiveFilter(); + + if (isset($pageSize) && intval($pageSize) && intval($pageSize) > 0) { + $this->_faqCollection->setPageSize(intval($pageSize)); + } + } + + return $this->_faqCollection; + } + + /** + * Returns all active categories + * + * @return Flagbit_Faq_Model_Mysql4_Category_Collection + */ + public function getCategoryCollection() + { + $categories = $this->getData('category_collection'); + if (is_null($categories)) { + $categories = Mage::getResourceSingleton('flagbit_faq/category_collection') + ->addStoreFilter(Mage::app()->getStore()) + ->setOrder('position','ASC') + ->addIsActiveFilter(); + $this->setData('category_collection', $categories); + } + return $categories; + } + + /** + * Returns the item collection for the given category + * + * @param Flagbit_Faq_Model_Category $category + * @return Flagbit_Faq_Model_Mysql4_Faq_Collection + */ + public function getItemCollectionByCategory(Flagbit_Faq_Model_Category $category) + { + return $category->getItemCollection()->addIsActiveFilter()->addStoreFilter(Mage::app()->getStore())->setOrder('position','ASC'); + } + + /** + * Simple helper function to determine, whether there are FAQ entries or not. + * + * @return boolean True, if FAQ are given. + */ + public function hasFaq() + { + return $this->getFaqCollection()->getSize() > 0; + } + + public function getIntro($faqItem) + { + $_intro = strip_tags($faqItem->getContent()); + $_intro = mb_substr($_intro, 0, mb_strpos($_intro, "\n")); + + $length = 100 - mb_strlen($faqItem->getQuestion()); + if ($length < 0) { + return ''; + } + if (mb_strlen($_intro) > $length) { + $_intro = mb_substr($_intro, 0, $length); + $_intro = mb_substr($_intro, 0, mb_strrpos($_intro, ' ')).'...'; + } + + return $_intro; + } + + /** + * Returns + * + * @return array + */ + public function getFaqJumplist() + { + if(is_null($this->_faqJumplist)) + { + $this->_faqJumplist = Mage::helper('flagbit_faq/jumplist'); + $this->_faqJumplist->setFaqItems($this->getFaqCollection()); + } + return $this->_faqJumplist; + } + + /** + * Simple helper function to determine, whether we should display a jumplist or not. + * + * @return boolean True if the jumplist should be displayed + */ + public function hasFaqJumplist() { + // TODO add configuration option to enable/disable jumplist + return count($this->getFaqJumplist()) > 0; + } + + /** + * Lists our FAQ items (individual questions) by popularity. This allows you + * to show the most popular questions on the FAQ index page. + * + * @var int Number of items to show per page (SQL LIMIT). + * @var int Number of the page to display, paired with $limit + * @return Flagbit_Faq_Model_Mysql_Faq_Collection collection of current FAQ entries + */ + public function getPopularQuestions($limit = 10, $page = 1) + { + $collection = Mage::getModel('flagbit_faq/faq') + ->getCollection() + ->setPageSize($limit) + ->setCurPage($page); + + // Order by popularity. For more information on why this is necessary + // instead of setOrder() or addAttributeToSort() see http://goo.gl/Jeq3h + $collection->getSelect()->order("popularity DESC"); + + return $collection; + } + + public function encodeQuestionForUrl($question) + { + return urlencode( + trim( + str_replace( + array(' ', 'ä', 'ö', 'ü', 'ß', '.', '/', ';', ':', '=', '?', '__'), + array('_', 'ae', 'oe', 'ue', 'ss', '_', '', '', '', '', '', '_'), + strtolower($question) + ), ' _' + ) + ); + } +} diff --git a/src/app/code/community/Flagbit/Faq/Block/Widget/Grid/Column/Renderer/Media.php b/src/app/code/community/Flagbit/Faq/Block/Widget/Grid/Column/Renderer/Media.php new file mode 100755 index 0000000..4b5faad --- /dev/null +++ b/src/app/code/community/Flagbit/Faq/Block/Widget/Grid/Column/Renderer/Media.php @@ -0,0 +1,12 @@ +getIcon().'" style="height: 50px;max-width: 50px" />'; + return $html; + } + +} \ No newline at end of file diff --git a/src/app/code/community/Flagbit/Faq/Helper/Data.php b/src/app/code/community/Flagbit/Faq/Helper/Data.php index 24fe178..f8488b3 100644 --- a/src/app/code/community/Flagbit/Faq/Helper/Data.php +++ b/src/app/code/community/Flagbit/Faq/Helper/Data.php @@ -1,41 +1,48 @@ - - */ - -/** - * FAQ for Magento - * - * @category Flagbit - * @package Flagbit_Faq - * @author Flagbit GmbH & Co. KG - */ -class Flagbit_Faq_Helper_Data extends Mage_Core_Helper_Abstract -{ - /** - * Returns config data - * - * @param string $field Requested field - * @return array config Configuration information - */ - public function getConfigData($field) - { - $path = 'faq/config/' . $field; - $config = Mage::getStoreConfig($path, Mage::app()->getStore()); - return $config; - } - - /** - * Retrieve FAQ index url - * - * @return string - */ - public function getFaqIndexUrl() - { - return $this->_getUrl('faq'); - } -} + + */ + +/** + * FAQ for Magento + * + * @category Flagbit + * @package Flagbit_Faq + * @author Flagbit GmbH & Co. KG + */ +class Flagbit_Faq_Helper_Data extends Mage_Core_Helper_Abstract +{ + + const MEDIA_PATH = 'wysiwyg/Flagbit/FAQ/'; + /** + * Returns config data + * + * @param string $field Requested field + * @return array config Configuration information + */ + public function getConfigData($field) + { + $path = 'faq/config/' . $field; + $config = Mage::getStoreConfig($path, Mage::app()->getStore()); + return $config; + } + + /** + * Retrieve FAQ index url + * + * @return string + */ + public function getFaqIndexUrl() + { + return $this->_getUrl('faq'); + } + + public function createSlug($urlString){ + return preg_replace('/[^A-Za-z0-9-]+/', '-', $urlString); + } + +} diff --git a/src/app/code/community/Flagbit/Faq/Model/Category.php b/src/app/code/community/Flagbit/Faq/Model/Category.php index ef6880c..c920342 100644 --- a/src/app/code/community/Flagbit/Faq/Model/Category.php +++ b/src/app/code/community/Flagbit/Faq/Model/Category.php @@ -29,6 +29,11 @@ public function getName() return $this->getCategoryName(); } + public function getIconUrl() + { + return Mage::getBaseUrl('media').$this->getData('icon'); + } + public function getItemCollection() { $collection = $this->getData('item_collection'); diff --git a/src/app/code/community/Flagbit/Faq/Model/Faq.php b/src/app/code/community/Flagbit/Faq/Model/Faq.php index be0395d..02afc87 100644 --- a/src/app/code/community/Flagbit/Faq/Model/Faq.php +++ b/src/app/code/community/Flagbit/Faq/Model/Faq.php @@ -1,26 +1,31 @@ - - */ - -/** - * FAQ for Magento - * - * @category Flagbit - * @package Flagbit_Faq - * @author Flagbit GmbH & Co. KG - */ -class Flagbit_Faq_Model_Faq extends Mage_Core_Model_Abstract -{ - /** - * Constructor - */ - protected function _construct() - { - $this->_init('flagbit_faq/faq'); - } -} + + */ + +/** + * FAQ for Magento + * + * @category Flagbit + * @package Flagbit_Faq + * @author Flagbit GmbH & Co. KG + */ +class Flagbit_Faq_Model_Faq extends Mage_Core_Model_Abstract +{ + /** + * Constructor + */ + protected function _construct() + { + $this->_init('flagbit_faq/faq'); + } + + public function getAnswer() { + $data = $this->getData('answer'); + return Mage::helper('cms')->getPageTemplateProcessor()->filter($data); + } +} diff --git a/src/app/code/community/Flagbit/Faq/Model/Mysql4/Faq/Collection.php b/src/app/code/community/Flagbit/Faq/Model/Mysql4/Faq/Collection.php index 35886e4..a8eddb1 100644 --- a/src/app/code/community/Flagbit/Faq/Model/Mysql4/Faq/Collection.php +++ b/src/app/code/community/Flagbit/Faq/Model/Mysql4/Faq/Collection.php @@ -1,138 +1,137 @@ - - */ - -/** - * FAQ for Magento - * - * @category Flagbit - * @package Flagbit_Faq - * @author Flagbit GmbH & Co. KG - */ -class Flagbit_Faq_Model_Mysql4_Faq_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract -{ - protected $_previewFlag; - - /** - * Constructor - * - */ - protected function _construct() - { - $this->_init('flagbit_faq/faq') - ->setOrder('question', 'ASC'); - } - - /** - * Creates an options array for grid filter functionality - * - * @return array Options array - */ - public function toOptionArray() - { - return $this->_toOptionArray('faq_id', 'question'); - } - - public function addIsActiveFilter() - { - $this->addFilter('is_active', 1); - return $this; - } - - /** - * Add Filter by category - * - * @param int|Flagbit_Faq_Model_Category $category Category to be filtered - * @return Flagbit_Faq_Model_Mysql4_Category_Collection - */ - public function addCategoryFilter($category) - { - if ($category instanceof Flagbit_Faq_Model_Category) { - $category = array($category->getId()); - } - - $this->getSelect()->join( - array('category_table' => $this->getTable('flagbit_faq/category_item')), - 'main_table.faq_id = category_table.faq_id', - array () - )->where('category_table.category_id in (?)', array ( - 0, - $category - ))->group('main_table.faq_id'); - - return $this; - } - - /** - * Add Filter by store - * - * @param int|Mage_Core_Model_Store $store Store to be filtered - * @return Flagbit_Faq_Model_Mysql4_Faq_Collection Self - */ - public function addStoreFilter($store) - { - if ($store instanceof Mage_Core_Model_Store) { - $store = array((int) $store->getId()); - } - - $fromParts = $this->getSelect()->getPart('from'); - - if (!isset($fromParts['store_table'])) { - $this->join( - array('store_table' => $this->getTable('flagbit_faq/faq_store')), - 'main_table.faq_id = store_table.faq_id' - ); - - $this->getSelect() - ->where('store_table.store_id in (?)', array(0, $store)) - ->group('main_table.faq_id') - ; - } - - return $this; - } - - /** - * After load processing - adds store information to the datasets - * - */ - protected function _afterLoad() - { - if ($this->_previewFlag) { - $items = $this->getColumnValues('faq_id'); - if (count($items)) { - $select = $this->getConnection()->select()->from( - $this->getTable('flagbit_faq/faq_store') - )->where( - $this->getTable('flagbit_faq/faq_store') . '.faq_id IN (?)', - $items - ); - if ($result = $this->getConnection()->fetchPairs($select)) { - foreach ($this as $item) { - if (!isset($result[$item->getData('faq_id')])) { - continue; - } - if ($result[$item->getData('faq_id')] == 0) { - $stores = Mage::app()->getStores(false, true); - $storeId = current($stores)->getId(); - $storeCode = key($stores); - } - else { - $storeId = $result[$item->getData('faq_id')]; - $storeCode = Mage::app()->getStore($storeId)->getCode(); - } - $item->setData('_first_store_id', $storeId); - $item->setData('store_code', $storeCode); - } - } - } - } - - parent::_afterLoad(); - } -} + + */ + +/** + * FAQ for Magento + * + * @category Flagbit + * @package Flagbit_Faq + * @author Flagbit GmbH & Co. KG + */ +class Flagbit_Faq_Model_Mysql4_Faq_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract +{ + protected $_previewFlag; + + /** + * Constructor + * + */ + protected function _construct() + { + $this->_init('flagbit_faq/faq'); + } + + /** + * Creates an options array for grid filter functionality + * + * @return array Options array + */ + public function toOptionArray() + { + return $this->_toOptionArray('faq_id', 'question'); + } + + public function addIsActiveFilter() + { + $this->addFilter('is_active', 1); + return $this; + } + + /** + * Add Filter by category + * + * @param int|Flagbit_Faq_Model_Category $category Category to be filtered + * @return Flagbit_Faq_Model_Mysql4_Category_Collection + */ + public function addCategoryFilter($category) + { + if ($category instanceof Flagbit_Faq_Model_Category) { + $category = array($category->getId()); + } + + $this->getSelect()->join( + array('category_table' => $this->getTable('flagbit_faq/category_item')), + 'main_table.faq_id = category_table.faq_id', + array () + )->where('category_table.category_id in (?)', array ( + 0, + $category + ))->group('main_table.faq_id'); + + return $this; + } + + /** + * Add Filter by store + * + * @param int|Mage_Core_Model_Store $store Store to be filtered + * @return Flagbit_Faq_Model_Mysql4_Faq_Collection Self + */ + public function addStoreFilter($store) + { + if ($store instanceof Mage_Core_Model_Store) { + $store = array((int) $store->getId()); + } + + $fromParts = $this->getSelect()->getPart('from'); + + if (!isset($fromParts['store_table'])) { + $this->join( + array('store_table' => $this->getTable('flagbit_faq/faq_store')), + 'main_table.faq_id = store_table.faq_id' + ); + + $this->getSelect() + ->where('store_table.store_id in (?)', array(0, $store)) + ->group('main_table.faq_id') + ; + } + + return $this; + } + + /** + * After load processing - adds store information to the datasets + * + */ + protected function _afterLoad() + { + if ($this->_previewFlag) { + $items = $this->getColumnValues('faq_id'); + if (count($items)) { + $select = $this->getConnection()->select()->from( + $this->getTable('flagbit_faq/faq_store') + )->where( + $this->getTable('flagbit_faq/faq_store') . '.faq_id IN (?)', + $items + ); + if ($result = $this->getConnection()->fetchPairs($select)) { + foreach ($this as $item) { + if (!isset($result[$item->getData('faq_id')])) { + continue; + } + if ($result[$item->getData('faq_id')] == 0) { + $stores = Mage::app()->getStores(false, true); + $storeId = current($stores)->getId(); + $storeCode = key($stores); + } + else { + $storeId = $result[$item->getData('faq_id')]; + $storeCode = Mage::app()->getStore($storeId)->getCode(); + } + $item->setData('_first_store_id', $storeId); + $item->setData('store_code', $storeCode); + } + } + } + } + + parent::_afterLoad(); + } +} diff --git a/src/app/code/community/Flagbit/Faq/controllers/Adminhtml/Faq/CategoryController.php b/src/app/code/community/Flagbit/Faq/controllers/Adminhtml/Faq/CategoryController.php index 009c72c..d7684f2 100644 --- a/src/app/code/community/Flagbit/Faq/controllers/Adminhtml/Faq/CategoryController.php +++ b/src/app/code/community/Flagbit/Faq/controllers/Adminhtml/Faq/CategoryController.php @@ -79,7 +79,7 @@ public function editAction() if (!empty($data)) { $category->setData($data); } - + Mage::register('faq_category', $category); $this->_initAction() @@ -122,6 +122,33 @@ public function saveAction() // try to save it try { + + if(isset($_FILES['icon']['name']) && (file_exists($_FILES['icon']['tmp_name']))) { + $uploader = new Varien_File_Uploader('icon'); + $uploader->setAllowedExtensions(array('jpg','jpeg','gif','png','svg')); + $uploader->setAllowRenameFiles(false); + $uploader->setFilesDispersion(false); + + // Set media as the upload dir + $media_path = Mage::getBaseDir('media'); + + $filename = Mage::helper('flagbit_faq')->createSlug($data['category_name']) . implode('-',$data['stores']) . '.' . pathinfo($_FILES['icon']['name'],PATHINFO_EXTENSION); + + // Upload the image + $r = $uploader->save($media_path . DS . Flagbit_Faq_Helper_Data::MEDIA_PATH, $filename); + $filename = $r['file']; + + $category->setIcon( Flagbit_Faq_Helper_Data::MEDIA_PATH . $filename); + } else { + if(isset($postData['icon']['delete']) && $postData['icon']['delete'] == 1) { + $category->setIcon(NULL); + } + else{ + $data['icon'] = $data['icon']['value']; + $category->setIcon($data['icon']); + } + } + // save the data $category->save(); diff --git a/src/app/code/community/Flagbit/Faq/etc/config.xml b/src/app/code/community/Flagbit/Faq/etc/config.xml index 172ea40..d7c5b3a 100644 --- a/src/app/code/community/Flagbit/Faq/etc/config.xml +++ b/src/app/code/community/Flagbit/Faq/etc/config.xml @@ -1,135 +1,142 @@ - - - - - true - community - 1.1.4 - - - - - - - - - Flagbit_Faq_Adminhtml - - - - - - - - - - standard - - Flagbit_Faq - faq - - - - - - - - Flagbit_Faq.csv - - - - - - - - faq.xml - - - - - - - - - Flagbit_Faq_Helper - - - - - - Flagbit_Faq_Block - - - - - - Flagbit_Faq_Model - flagbit_faq_mysql4 - - - Flagbit_Faq_Model_Mysql4 - - - faq_category
-
- - faq_category_item
-
- - faq_category_store
-
- - faq
-
- - faq_store
-
-
-
-
- - - - - Flagbit_Faq - - - core_setup - - - - - core_write - - - - - core_read - - - -
- - - - - - - Flagbit_Faq.csv - - - - - - - - - - - Flagbit_Faq.csv - - - - - -
+ + + + + true + community + 1.1.6 + + + + + + + + + Flagbit_Faq_Adminhtml + + + + + + + + + + standard + + Flagbit_Faq + faq + + + + + + + + Flagbit_Faq.csv + + + + + + + + faq.xml + + + + + + + + + Flagbit_Faq_Helper + + + + + + Flagbit_Faq_Block + + + + + + Flagbit_Faq_Model + flagbit_faq_mysql4 + + + Flagbit_Faq_Model_Mysql4 + + + faq_category
+
+ + faq_category_item
+
+ + faq_category_store
+
+ + faq
+
+ + faq_store
+
+
+
+
+ + + + + Flagbit_Faq + + + core_setup + + + + + core_write + + + + + core_read + + + +
+ + + + + + + Flagbit_Faq.csv + + + + + + + + faq.xml + + + + + + + + + + Flagbit_Faq.csv + + + + + +
diff --git a/src/app/code/community/Flagbit/Faq/sql/faq_setup/mysql4-upgrade-1.1.4-1.1.5.php b/src/app/code/community/Flagbit/Faq/sql/faq_setup/mysql4-upgrade-1.1.4-1.1.5.php new file mode 100644 index 0000000..7e9ee4f --- /dev/null +++ b/src/app/code/community/Flagbit/Faq/sql/faq_setup/mysql4-upgrade-1.1.4-1.1.5.php @@ -0,0 +1,27 @@ + + */ + +$installer = $this; + +$installer->startSetup(); + +$installer->run(" +ALTER TABLE `{$this->getTable('flagbit_faq/category')}` + ADD COLUMN `position` int(10) NOT NULL DEFAULT '0' +"); +$installer->run(" +ALTER TABLE `{$this->getTable('flagbit_faq/faq')}` + ADD COLUMN `position` int(10) NOT NULL DEFAULT '0' +"); +$installer->run(" +ALTER TABLE `{$this->getTable('flagbit_faq/category')}` + ADD COLUMN `icon` VARCHAR(255) NULL +"); + +$installer->endSetup(); diff --git a/src/app/code/community/Flagbit/Faq/sql/faq_setup/mysql4-upgrade-1.1.5-1.1.6.php b/src/app/code/community/Flagbit/Faq/sql/faq_setup/mysql4-upgrade-1.1.5-1.1.6.php new file mode 100644 index 0000000..98182e1 --- /dev/null +++ b/src/app/code/community/Flagbit/Faq/sql/faq_setup/mysql4-upgrade-1.1.5-1.1.6.php @@ -0,0 +1,22 @@ +startSetup(); + +$path = Mage::getBaseDir('media') . DS . 'Flagbit' . DS . 'FAQ'; + +function mkdir_r($dirName, $rights=0777){ + $dirs = explode(DS, $dirName); + $dir=''; + foreach ($dirs as $part) { + $dir.=$part.DS; + if (!is_dir($dir) && strlen($dir)>0) + mkdir($dir, $rights); + } +} +try{ + mkdir_r($path); +}catch (Exception $exception){ + +} + +$installer->endSetup(); diff --git a/src/app/design/adminhtml/default/default/layout/faq.xml b/src/app/design/adminhtml/default/default/layout/faq.xml new file mode 100644 index 0000000..0b3ee46 --- /dev/null +++ b/src/app/design/adminhtml/default/default/layout/faq.xml @@ -0,0 +1,19 @@ + + + + + + + js_cssprototype/windows/themes/default.css + lib/prototype/windows/themes/magento.css + + 1 + + + + + + + + + diff --git a/src/app/locale/fr_FR/Flagbit_Faq.csv b/src/app/locale/fr_FR/Flagbit_Faq.csv new file mode 100644 index 0000000..ac8d419 --- /dev/null +++ b/src/app/locale/fr_FR/Flagbit_Faq.csv @@ -0,0 +1,57 @@ +"Action","Action" +"Active","Actif" +"Add New FAQ Category","Ajouter une catégorie FAQ" +"Add New FAQ Item","Ajouter une question FAQ" +"All Store Views","Toutes les vues magasin" +"Answer","Réponse" +"Back","Retour" +"Back to the FAQ overview", "Retour à la vue d'ensemble" +"Category","Catégorie" +"Category #","Catégorie #" +"Category Information","Information sur la catégorie" +"Category Name","Nom de la catégorie" +"Content","Contenu" +"Delete FAQ item","Supprimer la question" +"Disabled","Désactiver" +"Display all FAQ items","Afficher toutes les questions" +"Edit","Editer" +"Edit FAQ item '%s'","Editer la question '%s'" +"Enabled","Activer" +"FAQ Item was successfully saved","La question a bien été sauvegardée" +"FAQ","FAQ" +"FAQ #","Entrée #" +"FAQ item information","Réponde" +"FAQ item question","Question" +"FAQ overview","Vue d'ensemble FAQ" +"General information","Information générale" +"HTML answer","réponse en HTML" +"Images","Images" +"Manage Categories","Gérer les catégorie" +"Manage FAQ Categories","Gérer les catégorie FAQ" +"Manage FAQ Items","Gérer les questions FAQ" +"Manage Items","Gérer les questions" +"New FAQ Category","Nouvelle catégorie FAQ" +"New FAQ item","Nouvelle question FAQ" +"No","Nom" +"No records found.","Aucune entrée trouvée." +"of %s pages","sur %d pages" +"Page","Page" +"Page status","Status de la page" +"per page","par page" +"Publication date","Date de publication" +"Published on","Publié le" +"Reset","Remise à zéro" +"Reset Filter","Remise à zéro des filtres" +"Save and continue edit","Enregistrer et continuer à editer" +"Save FAQ Category","Enregistrer la categorie" +"Save FAQ item","Enregistrer la question" +"Search","Chercher" +"Status","Status" +"Store view","Vue magasin" +"There are no FAQ items at the moment.","Il n'y a aucune entrée FAQ pour le moment." +"Question","Question" +"Total %d records found","%s questions trouvées" +"View","Voir" +"Yes","Oui" +"position","Ordre" +"Categories","Catégories" \ No newline at end of file