Thread Rating:
  • 2 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Item Manager Extended (Beta)
#1

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
THIS IS AN OLD VERSION. Get the new one at the URL: http://get-simple.info/extend/plugin/itemmanager/936/
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////



Item Manager Extended is a remake of the original Items Manager created by Pyc to simple manage articles, products, services, and other related items.

Source is available now on GitHub at: iManager

REQUIREMENTS:
  • GetSimple CMS up to version 3.x and higher.
  • GD Library

CHANGES / FEATURES:
  • Complete separation of design and logic
  • Assigning of customfields to categories
  • Pagination of item lists incduded
  • Back-end Management has been redesigned and updated
  • The custom fields part of Mvlcek Custom Fields plugin has been integrated into the Item Manager environment
  • Upload functionality has been changed or added
  • Some JavaScript functions removed temporarily

SETUP:
  1. Make sure to save an older version of Items Manager for the case that you decide to stay with it!
    -> Just save a copy of the files to a different location.
    -> After that, delete old version data to prevent naming collisions.
  2. Download 'Item Manager Extended' and unzip its files to the /plugins folder
  3. While logged in to GS, go to Plugins and activate Item Manager, join to the plugin menu at the top of the 'Item Manager' tab and go through the setup process:
    -> It will creates some directories and files.
  4. After set up you will be told which files have been created. In case of failure of the setup all these files must be added manually to the project.

CONFIGURATIONS MENU:
  • Item Manager -> CATEGORIES. Allows you to define new categories for optimizing your item management.
  • Item Manager -> CONFIGURE. This menu provides custom fields that you can use to organize your items.
  • Item Manager -> ADD NEW. This menu point enables to generate new Items.
  • Item Manager -> VIEW ALL. This list contains all the Items that are available at the moment.

To read or output data on front-end you shall to use the appropriate API calls of the Item Manager. Item Manager provides some methods that allow you to save, process and display your own item categories. The implementation are based on the object-oriented approach, which allows the arbitrary combination of this methods. This feature gives Item Manager a great deal of flexibility in how it can be used.

HOW TO USE TEMPLATES:
The Item Manager plugin uses templates to produce all it's front-end and back-end output, therefor it is possible to manipulate the look without knowing PHP at all. Manager templates are bits of static text contained placeholders and stored in '.tpl' files or (at your option) inserted as a string in the source code.  You can move any of these pieces around, change their parameters, and adjust their placing. The existing default templates are solely a base structure - if you want your placeholders at the bottom, for instance, move them there! Item Manager doesn't restrict you from doing that. All these templates are located in the 'plugins/imanager/tpl' directory. You can create your own templates or use these standard templates.


USAGE EXAMPLE:
Ok, I'll try to give you an example of how you could use Item Manager to create a simple product catalog that might then look like this: sample.
See also a further example how to use Item Manager as substitute of Fancybox.
One thing before we start, Item Manager is modular, and your product catalog can function in any scope you like. If you don't need any specific part of methods, just skip that.

First off, you'll want to open the CATEGORIES menu,  and create a new category, we call it 'rings'.

categories
[Image: cat001.png]


Next, click the CONFIGURE menu, in this area  you will want to customize your category structures by adding custom fields precisely to your specific requirements. So, let us start by creating:

  • One textarea for our item description
  • 4 upload fields for our thumbnails
  • 4 fields for the main images
  • A single field 'sequence' to determine the order of products displayed in the catalog
 

configure 
[Image: configure.jpg]


After you have made all of your custom fields, your next step is to add new items to an existing category using the ADD NEW menu point. To see the items you have created, go to the VIEW ALL menu. Your items list will appear as follows.

view all
[Image: view.png]


CREATING CONTROLLER COMPONENTS:
You don't currently have the possibility to specify the item output from the back-end area. For this reason your next step should be creating a suitable front-end snippets that includes several methods for setting and manipulating the output. In our example case, you could use two different viewing modes 'List' and 'Details' view. The easiest way of getting a Manager output on the front-end of your website is just to create two components 'im_list_page_generator' and 'im_details_page_generator'. Include these components in your website template, better still, embed these directly in your GS pages by using DynPages plugin. The 'DynPages' plugin allows you to use a placeholder to include the components on the page by specifying their name: {% im_list_page_generator %}

Sample im_list_page_generator:
PHP Code:
<?php
// create controller instance
$manager = new ImController();
// setup category
ImCategory::setCategory('rings');
// limiting items per page
ImModel::setPref('itemsperpage'10);
// setup sort by field
ImModel::setPref('sortby''sequence');
// setup details page
ImModel::setPref('page''item-manager-details-page');
/* Run action: generates item register calculated out of all the mentioned parameters.
   For this example's purpose, we'll need two custom fields in our List view: a 'thumb' to 
   display as a link to our Details page and 'sequence' to determine the order of products
   displayed. */
$manager->runModelMethod('gen_register', array('loop-thumb-1''sequence'));
/* This method returns an array which contains multiple item data specified by gen_register and   
   depending on the settings made. */ 
$items $manager->getModelValue('items_ordered_struct');
// Returns a page data array based on the settings made
$pagedata $manager->getModelValue('pagedata');
// templates as strings, just for demonstration
if(!$manager->tplRegister(array('loop' => 
 
   '<div class="im-resultwrap">'
 
       .'<a class="im-itempic" href="[[page]]?item=[[ slug ]]"><img alt="" class="im-pic" src="[[ loop-thumb-1 ]]" /><span class="im-hidden"></span></a>'
 
   .'</div>''frontendlist' => '<div id="manager">[[ loop ]][[ paginator ]]</div>')))
{
 
   return;
}
// string append
$loop '';
foreach(
$pagedata['itemkeys'] as $key)
{
 
   // Renders the 'loop' template to string concatenation by replacing placeholders
 
  $loop .= $manager->paint('loop', array('loop-thumb-1' => $items[$key]['loop-thumb-1'], 
 
               'page' => $pagedata['viewpage'], 'slug' => $items[$key]['slug']));
}
/* If we want to split our item data across several pages, for instance, with 'Previous/Next' 
   links, for this, we can use already existing default templates. We then call the paginator()
   method in a controller action. This method gets passed the default paginator templates by
   calling the getTplKit('paginator') before paint() renders the template to output */
echo $manager->paint('frontendlist', array('loop' => $loop
 
       'paginator' => $manager->paginator(ImModel::getTplKit('paginator'))));
?>

Sample im_details_page_generator:
PHP Code:
<?php
$manager 
= new ImController();
$id = isset($_GET['item']) ? $_GET['item'] : '';
/* This method returns an array which contains detailed data of a single item 
   specified by item ID */
if(!$itemdata $manager->runModelMethod('get_item_data'$id))
{
 
   return;
}
$path ImModel::getProp('paths''siteurl').ITEMUPLOADDIR;
// templates as files for demonstration
if(!$manager->tplRegister(array('details' =>
 
   GSPLUGINPATH.'imanager/tpl/frontend/page.details.tpl'
 
   'detailsloop' =>  GSPLUGINPATH.'imanager/tpl/frontend/page.details.loop.tpl')))
{
 
   return;
}
$loop '';
$preload = array();
for(
$i=1$i 6$i++) {
 
   if(!empty($itemdata->{'loop-thumb-'.$i})) {
 
       $loop .= $manager->paint('detailsloop', array('count' => $i));
 
   }
 
   if(!empty($itemdata->{'image-'.$i})) {
 
       $preload[]= '"[[image-'.$i.']]"';
 
   }
}
$preload implode(','$preload);
$manager->tplRegister(array('currloop' => $loop));
$loop $manager->paint('currloop', array(
 
   'image-1' => $path.basename($itemdata->{'image-1'}),
 
   'image-2' => $path.basename($itemdata->{'image-2'}),
 
   'image-3' => $path.basename($itemdata->{'image-3'}),
 
   'image-4' => $path.basename($itemdata->{'image-4'}),
 
   'image-5' => $path.basename($itemdata->{'image-5'}),
 
   'image-6' => $path.basename($itemdata->{'image-6'}),
 
   'loop-thumb-1' => $path.basename($itemdata->{'loop-thumb-1'}),
 
   'loop-thumb-2' => $path.basename($itemdata->{'loop-thumb-2'}),
 
   'loop-thumb-3' => $path.basename($itemdata->{'loop-thumb-3'}),
 
   'loop-thumb-4' => $path.basename($itemdata->{'loop-thumb-4'}),
 
   'loop-thumb-5' => $path.basename($itemdata->{'loop-thumb-5'}),
 
   'loop-thumb-6' => $path.basename($itemdata->{'loop-thumb-6'}))
);
echo 
$manager->paint('details', array(
 
   'preload' => $preload,
 
   'image-1' => $path.basename($itemdata->{'image-1'}),
 
   'image-2' => $path.basename($itemdata->{'image-2'}),
 
   'image-3' => $path.basename($itemdata->{'image-3'}),
 
   'image-4' => $path.basename($itemdata->{'image-4'}),
 
   'image-5' => $path.basename($itemdata->{'image-5'}),
 
   'image-6' => $path.basename($itemdata->{'image-6'}),
 
   'title' => stripslashes(html_entity_decode($itemdata->{'title'}, ENT_QUOTES'UTF-8')),
 
   'description' => stripslashes(html_entity_decode($itemdata->{'description'}, ENT_QUOTES'UTF-8')),
 
   'loop-tpl' => $loop)
);
?>

NOTE: This plugin is in Beta phase, meaning it is incomplete, please tell me describing any bugs or feature requests.
Reply


Messages In This Thread
Item Manager Extended (Beta) - by Bigin - 2013-06-15, 23:20:44
RE: Item Manager Extended (Beta) - by evan70 - 2013-06-16, 09:18:25
RE: Item Manager Extended (Beta) - by evan70 - 2013-06-17, 03:05:23
RE: Item Manager Extended (Beta) - by Bigin - 2013-06-17, 04:46:07
RE: Item Manager Extended (Beta) - by Oleg06 - 2013-06-17, 05:15:13
RE: Item Manager Extended (Beta) - by Bigin - 2013-06-17, 07:43:20
RE: Item Manager Extended (Beta) - by evan70 - 2013-06-25, 18:01:09
RE: Item Manager Extended (Beta) - by evan70 - 2013-06-25, 18:32:29
RE: Item Manager Extended (Beta) - by Bigin - 2013-06-25, 22:48:26
RE: Item Manager Extended (Beta) - by evan70 - 2013-06-25, 23:25:41
RE: Item Manager Extended (Beta) - by Bigin - 2013-06-26, 00:03:01
RE: Item Manager Extended (Beta) - by evan70 - 2013-06-26, 00:41:20
RE: Item Manager Extended (Beta) - by Bigin - 2013-06-26, 01:45:41
RE: Item Manager Extended (Beta) - by evan70 - 2013-06-26, 18:12:42
RE: Item Manager Extended (Beta) - by evan70 - 2013-06-26, 18:52:33
RE: Item Manager Extended (Beta) - by Rene - 2013-06-26, 23:03:12
RE: Item Manager Extended (Beta) - by evan70 - 2013-06-26, 23:51:59
RE: Item Manager Extended (Beta) - by Rene - 2013-09-30, 20:15:55
RE: Item Manager Extended (Beta) - by Bigin - 2013-10-03, 23:35:16
RE: Item Manager Extended (Beta) - by Bigin - 2013-06-27, 04:23:52
RE: Item Manager Extended (Beta) - by Rene - 2013-06-27, 16:09:44
RE: Item Manager Extended (Beta) - by morvy - 2013-06-27, 05:04:08
RE: Item Manager Extended (Beta) - by Bigin - 2013-06-27, 15:59:53
RE: Item Manager Extended (Beta) - by amnesiac - 2013-08-15, 22:28:56
RE: Item Manager Extended (Beta) - by Bigin - 2013-08-16, 01:59:04
RE: Item Manager Extended (Beta) - by amnesiac - 2013-08-18, 22:29:34
RE: Item Manager Extended (Beta) - by D.O. - 2013-08-18, 20:43:36
RE: Item Manager Extended (Beta) - by Bigin - 2013-08-19, 23:24:48
RE: Item Manager Extended (Beta) - by D.O. - 2013-08-20, 00:37:26
RE: Item Manager Extended (Beta) - by Rene - 2013-08-20, 22:43:54
RE: Item Manager Extended (Beta) - by Bigin - 2013-08-19, 23:08:39
RE: Item Manager Extended (Beta) - by amnesiac - 2013-08-20, 22:21:29
RE: Item Manager Extended (Beta) - by Bigin - 2013-08-20, 23:31:17
RE: Item Manager Extended (Beta) - by amnesiac - 2013-08-20, 23:45:14
RE: Item Manager Extended (Beta) - by Bigin - 2013-08-20, 19:19:15
RE: Item Manager Extended (Beta) - by D.O. - 2013-08-21, 06:09:02
RE: Item Manager Extended (Beta) - by Bigin - 2013-08-21, 00:00:35
RE: Item Manager Extended (Beta) - by amnesiac - 2013-08-21, 00:48:15
RE: Item Manager Extended (Beta) - by ncsic - 2013-08-21, 18:23:30
RE: Item Manager Extended (Beta) - by Bigin - 2013-08-21, 19:20:29
RE: Item Manager Extended (Beta) - by ncsic - 2013-08-21, 21:15:38
RE: Item Manager Extended (Beta) - by opti - 2013-09-19, 22:45:27
RE: Item Manager Extended (Beta) - by Bigin - 2013-09-21, 20:14:58
RE: Item Manager Extended (Beta) - by Bigin - 2013-09-23, 04:28:05
RE: Item Manager Extended (Beta) - by Rene - 2013-10-04, 00:00:38
RE: Item Manager Extended (Beta) - by thisnthat - 2013-11-12, 14:18:41
RE: Item Manager Extended (Beta) - by Bigin - 2013-11-13, 16:47:20
RE: Item Manager Extended (Beta) - by thisnthat - 2013-11-14, 10:16:39
RE: Item Manager Extended (Beta) - by Bigin - 2013-11-14, 16:53:01
RE: Item Manager Extended (Beta) - by thisnthat - 2013-11-15, 09:32:52
RE: Item Manager Extended (Beta) - by smooo3 - 2013-11-23, 05:36:55
RE: Item Manager Extended (Beta) - by smooo3 - 2013-11-23, 05:53:54
RE: Item Manager Extended (Beta) - by Bigin - 2013-11-23, 23:42:52
RE: Item Manager Extended (Beta) - by smooo3 - 2013-11-26, 07:34:33
RE: Item Manager Extended (Beta) - by Bigin - 2013-11-27, 07:05:56
RE: Item Manager Extended (Beta) - by smooo3 - 2013-11-28, 05:25:21
RE: Item Manager Extended (Beta) - by Bigin - 2013-11-30, 03:34:31
RE: Item Manager Extended (Beta) - by smooo3 - 2013-11-30, 03:56:58
RE: Item Manager Extended (Beta) - by Bigin - 2014-03-07, 05:27:29
RE: Item Manager Extended (Beta) - by MicroCAD - 2014-04-22, 01:00:43
RE: Item Manager Extended (Beta) - by Bigin - 2014-04-22, 04:52:49
RE: Item Manager Extended (Beta) - by MicroCAD - 2014-04-27, 03:27:40
RE: Item Manager Extended (Beta) - by xxdex - 2014-06-13, 17:35:52
RE: Item Manager Extended (Beta) - by Bigin - 2014-06-14, 20:33:15
RE: Item Manager Extended (Beta) - by xxdex - 2014-06-16, 19:24:12
RE: Item Manager Extended (Beta) - by Bigin - 2014-06-17, 06:42:41
RE: Item Manager Extended (Beta) - by Bigin - 2014-06-17, 16:08:24
RE: Item Manager Extended (Beta) - by morvy - 2014-06-16, 19:30:31
RE: Item Manager Extended (Beta) - by xxdex - 2014-06-16, 20:12:41
RE: Item Manager Extended (Beta) - by xxdex - 2014-06-23, 18:05:28
RE: Item Manager Extended (Beta) - by xxdex - 2014-06-24, 02:21:26
RE: Item Manager Extended (Beta) - by shawn_a - 2014-06-24, 02:41:14
RE: Item Manager Extended (Beta) - by xxdex - 2014-06-24, 05:59:36
RE: Item Manager Extended (Beta) - by xxdex - 2014-06-24, 06:42:42
RE: Item Manager Extended (Beta) - by shawn_a - 2014-06-24, 08:00:53
RE: Item Manager Extended (Beta) - by xxdex - 2014-06-24, 08:17:04
RE: Item Manager Extended (Beta) - by Bigin - 2014-06-24, 09:01:45
RE: Item Manager Extended (Beta) - by shawn_a - 2014-06-24, 10:28:18
RE: Item Manager Extended (Beta) - by ak40u - 2014-07-10, 01:20:09
RE: Item Manager Extended (Beta) - by Bigin - 2014-07-10, 05:44:41
RE: Item Manager Extended (Beta) - by ak40u - 2014-07-10, 06:10:38
RE: Item Manager Extended (Beta) - by shawn_a - 2014-07-10, 06:09:53
RE: Item Manager Extended (Beta) - by ak40u - 2014-07-10, 18:14:29
RE: Item Manager Extended (Beta) - by Bigin - 2014-07-10, 19:23:53
RE: Item Manager Extended (Beta) - by ak40u - 2014-07-11, 05:09:19
RE: Item Manager Extended (Beta) - by Bigin - 2014-07-11, 16:35:49
RE: Item Manager Extended (Beta) - by ak40u - 2014-07-12, 03:18:06
RE: Item Manager Extended (Beta) - by ak40u - 2014-07-12, 16:48:49
RE: Item Manager Extended (Beta) - by Bigin - 2014-07-12, 19:07:40
RE: Item Manager Extended (Beta) - by ak40u - 2014-07-13, 06:23:24
RE: Item Manager Extended (Beta) - by lukinhasb - 2014-07-15, 05:46:42
RE: Item Manager Extended (Beta) - by lukinhasb - 2014-07-15, 07:40:47
RE: Item Manager Extended (Beta) - by Bigin - 2014-07-15, 15:38:00
RE: Item Manager Extended (Beta) - by xxdex - 2014-08-06, 09:07:00
RE: Item Manager Extended (Beta) - by Bigin - 2014-08-07, 03:19:43
RE: Item Manager Extended (Beta) - by xxdex - 2014-08-10, 06:39:44
RE: Item Manager Extended (Beta) - by datiswous - 2014-08-21, 03:09:21
RE: Item Manager Extended (Beta) - by Bigin - 2014-08-24, 18:02:35
RE: Item Manager Extended (Beta) - by linden - 2014-09-22, 16:33:05
RE: Item Manager Extended (Beta) - by Bigin - 2014-09-25, 16:02:55
RE: Item Manager Extended (Beta) - by tuxy - 2014-12-13, 10:32:49
RE: Item Manager Extended (Beta) - by shawn_a - 2014-12-13, 10:58:15
RE: Item Manager Extended (Beta) - by tuxy - 2014-12-13, 11:04:59
RE: Item Manager Extended (Beta) - by tuxy - 2014-12-13, 11:16:18
RE: Item Manager Extended (Beta) - by tuxy - 2014-12-13, 11:19:46
RE: Item Manager Extended (Beta) - by tuxy - 2014-12-13, 17:52:26
RE: Item Manager Extended (Beta) - by bensayers - 2014-12-25, 00:52:34
RE: Item Manager Extended (Beta) - by datiswous - 2014-12-26, 23:31:33
RE: Item Manager Extended (Beta) - by bensayers - 2014-12-28, 06:53:48
RE: Item Manager Extended (Beta) - by bensayers - 2015-01-17, 05:26:03
RE: Item Manager Extended (Beta) - by Bigin - 2014-12-30, 21:05:11
RE: Item Manager Extended (Beta) - by bensayers - 2014-12-31, 03:32:12
RE: Item Manager Extended (Beta) - by Bigin - 2015-01-01, 04:44:03
RE: Item Manager Extended (Beta) - by datiswous - 2014-12-26, 23:50:52
RE: Item Manager Extended (Beta) - by Bigin - 2014-12-30, 21:09:33
RE: Item Manager Extended (Beta) - by tuxy - 2015-01-15, 09:10:13
RE: Item Manager Extended (Beta) - by Angryboy - 2015-01-15, 22:37:55
RE: Item Manager Extended (Beta) - by mjbraun - 2015-01-16, 02:15:49
RE: Item Manager Extended (Beta) - by tuxy - 2015-01-16, 05:49:31
RE: Item Manager Extended (Beta) - by 11ecom - 2015-04-23, 03:45:31
RE: Item Manager Extended (Beta) - by Bigin - 2015-04-24, 05:52:01
RE: Item Manager Extended (Beta) - by Rico - 2015-04-30, 10:03:41
RE: Item Manager Extended (Beta) - by Bigin - 2015-04-30, 22:56:20
RE: Item Manager Extended (Beta) - by Bigin - 2015-04-30, 23:16:20
RE: Item Manager Extended (Beta) - by Rico - 2015-05-08, 01:57:02
RE: Item Manager Extended (Beta) - by Bigin - 2015-05-08, 15:07:34
RE: Item Manager Extended (Beta) - by Rico - 2015-05-09, 08:29:53
RE: Item Manager Extended (Beta) - by Bigin - 2015-05-09, 16:14:22
RE: Item Manager Extended (Beta) - by Rico - 2015-05-09, 21:14:28
RE: Item Manager Extended (Beta) - by Bigin - 2015-05-18, 01:57:43
RE: Item Manager Extended (Beta) - by ross104 - 2015-07-21, 19:07:37
RE: Item Manager Extended (Beta) - by Bigin - 2015-07-24, 06:39:42
IManager examples zipped - by Erick67 - 2015-08-15, 18:48:04
RE: Item Manager Extended (Beta) - by Bigin - 2015-08-15, 22:55:01
RE: Item Manager Extended (Beta) - by Erick67 - 2015-08-15, 23:13:38
RE: Item Manager Extended (Beta) - by Bigin - 2015-08-16, 00:02:04
RE: Item Manager Extended (Beta) - by Erick67 - 2015-08-16, 00:04:00
RE: Item Manager Extended (Beta) - by Bigin - 2015-08-16, 00:12:42



Users browsing this thread: 1 Guest(s)