SproutCMS

This is the code documentation for the SproutCMS project

class Itemlist

Used to generate HTML for a table of database records.
This is usually used for the admin/contents/* route which provides the main
UI to operators for a given ManagedAdminController

Source code (20 results)

/sprout/Controllers/Admin/ActionLogAdminController.php   Highlighted file source

Line 27: use Sprout\Helpers\Itemlist;
Line 179: $itemlist = new Itemlist();
Line 180: $itemlist->main_columns = array(
Line 186: $itemlist->items = $res;
Line 190: 'content' => $itemlist->render()

/sprout/Controllers/Admin/ActionLogAdminController.php   Highlighted file source

Line 27: use Sprout\Helpers\Itemlist;
Line 179: $itemlist = new Itemlist();
Line 180: $itemlist->main_columns = array(
Line 186: $itemlist->items = $res;
Line 190: 'content' => $itemlist->render()

/sprout/Controllers/Admin/ContentSubscriptionAdminController.php   Highlighted file source

Line 17: use Sprout\Helpers\Itemlist;
Line 57: * Formats a resultset of items into an Itemlist
Line 64: // Create the itemlist
Line 65: $itemlist = new Itemlist();
Line 66: $itemlist->main_columns = $this->main_columns;
Line 67: $itemlist->items = $items;
Line 68: $itemlist->setCheckboxes(true);
Line 69: $itemlist->setOrdering(true);
Line 70: $itemlist->setActionsClasses('button button-small');
Line 74: $itemlist->addAction($name, $url, 'button-grey');
Line 77: $itemlist->addAction('Duplicate', "SITE/admin/duplicate/{$this->controller_name}/%%", 'button-grey icon-before icon-add');
Line 80: $itemlist->addAction('Delete', "SITE/admin/delete/{$this->controller_name}/%%", 'button button-red icon-before icon-delete');
Line 85: $itemlist->setRowClassesFunc(function($row) use($visibility) {
Line 94: $outer = new View("sprout/admin/generic_itemlist_outer");
Line 99: $outer->itemlist = $itemlist->render();

/sprout/Controllers/Admin/ContentSubscriptionAdminController.php   Highlighted file source

Line 17: use Sprout\Helpers\Itemlist;
Line 57: * Formats a resultset of items into an Itemlist
Line 64: // Create the itemlist
Line 65: $itemlist = new Itemlist();
Line 66: $itemlist->main_columns = $this->main_columns;
Line 67: $itemlist->items = $items;
Line 68: $itemlist->setCheckboxes(true);
Line 69: $itemlist->setOrdering(true);
Line 70: $itemlist->setActionsClasses('button button-small');
Line 74: $itemlist->addAction($name, $url, 'button-grey');
Line 77: $itemlist->addAction('Duplicate', "SITE/admin/duplicate/{$this->controller_name}/%%", 'button-grey icon-before icon-add');
Line 80: $itemlist->addAction('Delete', "SITE/admin/delete/{$this->controller_name}/%%", 'button button-red icon-before icon-delete');
Line 85: $itemlist->setRowClassesFunc(function($row) use($visibility) {
Line 94: $outer = new View("sprout/admin/generic_itemlist_outer");
Line 99: $outer->itemlist = $itemlist->render();

/sprout/Controllers/Admin/HasCategoriesAdminController.php   Highlighted file source

Line 28: use Sprout\Helpers\Itemlist;
Line 398: * Formats a resultset of items into an Itemlist
Line 405: // Create the itemlist
Line 406: $itemlist = new Itemlist();
Line 407: $itemlist->main_columns = $this->main_columns;
Line 408: $itemlist->items = $items;
Line 409: $itemlist->setCheckboxes(true);
Line 410: $itemlist->setOrdering(true);
Line 411: $itemlist->setActionsClasses('button button-small');
Line 414: $itemlist->addAction('edit', "SITE/admin/edit/{$this->controller_name}/%%");
Line 416: $itemlist->addAction($name, $url, 'button-grey');
Line 419: $itemlist->addAction('Duplicate', "SITE/admin/duplicate/{$this->controller_name}/%%", 'button-grey icon-before icon-add');
Line 422: $itemlist->addAction('Delete', "SITE/admin/delete/{$this->controller_name}/%%", 'button button-red icon-before icon-delete');
Line 427: $itemlist->setRowClassesFunc(function($row) use($visibility) {
Line 436: $outer = new View("sprout/admin/categories_itemlist_outer");
Line 442: $outer->itemlist = $itemlist->render();
Line 861: // Create the itemlist
Line 862: $itemlist = new Itemlist();
Line 863: $itemlist->main_columns = $this->main_columns;
Line 864: $itemlist->items = $items;
Line 865: $view->itemlist = $itemlist->render();

/sprout/Controllers/Admin/HasCategoriesAdminController.php   Highlighted file source

Line 28: use Sprout\Helpers\Itemlist;
Line 398: * Formats a resultset of items into an Itemlist
Line 405: // Create the itemlist
Line 406: $itemlist = new Itemlist();
Line 407: $itemlist->main_columns = $this->main_columns;
Line 408: $itemlist->items = $items;
Line 409: $itemlist->setCheckboxes(true);
Line 410: $itemlist->setOrdering(true);
Line 411: $itemlist->setActionsClasses('button button-small');
Line 414: $itemlist->addAction('edit', "SITE/admin/edit/{$this->controller_name}/%%");
Line 416: $itemlist->addAction($name, $url, 'button-grey');
Line 419: $itemlist->addAction('Duplicate', "SITE/admin/duplicate/{$this->controller_name}/%%", 'button-grey icon-before icon-add');
Line 422: $itemlist->addAction('Delete', "SITE/admin/delete/{$this->controller_name}/%%", 'button button-red icon-before icon-delete');
Line 427: $itemlist->setRowClassesFunc(function($row) use($visibility) {
Line 436: $outer = new View("sprout/admin/categories_itemlist_outer");
Line 442: $outer->itemlist = $itemlist->render();
Line 861: // Create the itemlist
Line 862: $itemlist = new Itemlist();
Line 863: $itemlist->main_columns = $this->main_columns;
Line 864: $itemlist->items = $items;
Line 865: $view->itemlist = $itemlist->render();

/sprout/Controllers/Admin/ManagedAdminController.php   Highlighted file source

Line 31: use Sprout\Helpers\Itemlist;
Line 106: * Actions for the itemlist
Line 420: // Create the itemlist for the preview section
Line 422: $export->itemlist = '<p><i>No records found which match the refinebar clauses specified.</i></p>';
Line 425: $itemlist = new Itemlist();
Line 426: $itemlist->main_columns = $cols;
Line 427: $itemlist->items = $items;
Line 428: $export->itemlist = $itemlist->render();
Line 1056: * Formats a resultset of items into an Itemlist
Line 1063: // Create the itemlist
Line 1064: $itemlist = new Itemlist();
Line 1065: $itemlist->main_columns = $this->main_columns;
Line 1066: $itemlist->items = $items;
Line 1067: $itemlist->setCheckboxes(true);
Line 1068: $itemlist->setOrdering(true);
Line 1069: $itemlist->setActionsClasses('button button-small');
Line 1072: $itemlist->addAction('edit', "SITE/admin/edit/{$this->controller_name}/%%");
Line 1074: $itemlist->addAction($name, $url, 'button-grey');
Line 1077: $itemlist->addAction('Duplicate', "SITE/admin/duplicate/{$this->controller_name}/%%", 'button-grey icon-before icon-add');
Line 1080: $itemlist->addAction('Delete', "SITE/admin/delete/{$this->controller_name}/%%", 'button button-red icon-before icon-delete');
Line 1085: $itemlist->setRowClassesFunc(function($row) use($visibility) {
Line 1094: $outer = new View("sprout/admin/generic_itemlist_outer");
Line 1099: $outer->itemlist = $itemlist->render();

/sprout/Controllers/Admin/ManagedAdminController.php   Highlighted file source

Line 31: use Sprout\Helpers\Itemlist;
Line 106: * Actions for the itemlist
Line 420: // Create the itemlist for the preview section
Line 422: $export->itemlist = '<p><i>No records found which match the refinebar clauses specified.</i></p>';
Line 425: $itemlist = new Itemlist();
Line 426: $itemlist->main_columns = $cols;
Line 427: $itemlist->items = $items;
Line 428: $export->itemlist = $itemlist->render();
Line 1056: * Formats a resultset of items into an Itemlist
Line 1063: // Create the itemlist
Line 1064: $itemlist = new Itemlist();
Line 1065: $itemlist->main_columns = $this->main_columns;
Line 1066: $itemlist->items = $items;
Line 1067: $itemlist->setCheckboxes(true);
Line 1068: $itemlist->setOrdering(true);
Line 1069: $itemlist->setActionsClasses('button button-small');
Line 1072: $itemlist->addAction('edit', "SITE/admin/edit/{$this->controller_name}/%%");
Line 1074: $itemlist->addAction($name, $url, 'button-grey');
Line 1077: $itemlist->addAction('Duplicate', "SITE/admin/duplicate/{$this->controller_name}/%%", 'button-grey icon-before icon-add');
Line 1080: $itemlist->addAction('Delete', "SITE/admin/delete/{$this->controller_name}/%%", 'button button-red icon-before icon-delete');
Line 1085: $itemlist->setRowClassesFunc(function($row) use($visibility) {
Line 1094: $outer = new View("sprout/admin/generic_itemlist_outer");
Line 1099: $outer->itemlist = $itemlist->render();

/sprout/Controllers/Admin/PageAdminController.php   Highlighted file source

Line 45: use Sprout\Helpers\Itemlist;
Line 459: $list = new Itemlist();
Line 2025: $list = new Itemlist();
Line 2044: $list = new Itemlist();
Line 2083: // Create the itemlist
Line 2084: $itemlist = new Itemlist();
Line 2085: $itemlist->main_columns = array('Name' => 'name', 'Date modified' => 'date_modified', 'Editor' => 'modified_editor');
Line 2086: $itemlist->items = $res;
Line 2087: $itemlist->addAction('edit', "SITE/admin/edit/{$this->controller_name}/%%");
Line 2089: $intro->recently_updated = $itemlist->render();
Line 2104: // Create the itemlist
Line 2105: $itemlist = new Itemlist();
Line 2106: $itemlist->main_columns = [
Line 2111: $itemlist->items = $res;
Line 2112: $itemlist->addAction('edit', 'SITE/admin/edit/page/%%#main-tabs-revs');
Line 2114: $intro->need_approval = $itemlist->render();
Line 2591: $itemlist = new Itemlist();
Line 2592: $itemlist->main_columns = [
Line 2597: $itemlist->items = $res;
Line 2598: $itemlist->addAction('edit', 'admin/edit/page/%%');
Line 2602: 'content' => $itemlist->render(),

/sprout/Controllers/Admin/PageAdminController.php   Highlighted file source

Line 45: use Sprout\Helpers\Itemlist;
Line 459: $list = new Itemlist();
Line 2025: $list = new Itemlist();
Line 2044: $list = new Itemlist();
Line 2083: // Create the itemlist
Line 2084: $itemlist = new Itemlist();
Line 2085: $itemlist->main_columns = array('Name' => 'name', 'Date modified' => 'date_modified', 'Editor' => 'modified_editor');
Line 2086: $itemlist->items = $res;
Line 2087: $itemlist->addAction('edit', "SITE/admin/edit/{$this->controller_name}/%%");
Line 2089: $intro->recently_updated = $itemlist->render();
Line 2104: // Create the itemlist
Line 2105: $itemlist = new Itemlist();
Line 2106: $itemlist->main_columns = [
Line 2111: $itemlist->items = $res;
Line 2112: $itemlist->addAction('edit', 'SITE/admin/edit/page/%%#main-tabs-revs');
Line 2114: $intro->need_approval = $itemlist->render();
Line 2591: $itemlist = new Itemlist();
Line 2592: $itemlist->main_columns = [
Line 2597: $itemlist->items = $res;
Line 2598: $itemlist->addAction('edit', 'admin/edit/page/%%');
Line 2602: 'content' => $itemlist->render(),

/sprout/Controllers/DbToolsController.php   Highlighted file source

Line 50: use Sprout\Helpers\Itemlist;
Line 973: $itemlist = new Itemlist();
Line 974: $itemlist->items = $results;
Line 975: $itemlist->main_columns = [
Line 981: $itemlist->setRowClassesFunc(function($row){
Line 984: echo $itemlist->render();
Line 2289: $itemlist = '<p><em>No items found</em></p>';
Line 2291: $itemlist = new Itemlist();
Line 2292: $itemlist->items = $res;
Line 2293: $itemlist->addAction('edit', 'dbtools/exceptionDetail?id=%%');
Line 2294: $itemlist->main_columns = array(
Line 2303: $view->itemlist = $itemlist;
Line 2920: $list = new Itemlist();

/sprout/Controllers/DbToolsController.php   Highlighted file source

Line 50: use Sprout\Helpers\Itemlist;
Line 973: $itemlist = new Itemlist();
Line 974: $itemlist->items = $results;
Line 975: $itemlist->main_columns = [
Line 981: $itemlist->setRowClassesFunc(function($row){
Line 984: echo $itemlist->render();
Line 2289: $itemlist = '<p><em>No items found</em></p>';
Line 2291: $itemlist = new Itemlist();
Line 2292: $itemlist->items = $res;
Line 2293: $itemlist->addAction('edit', 'dbtools/exceptionDetail?id=%%');
Line 2294: $itemlist->main_columns = array(
Line 2303: $view->itemlist = $itemlist;
Line 2920: $list = new Itemlist();

/sprout/Helpers/AdminDashboard.php   Highlighted file source

Line 109: // Create the itemlist
Line 110: $itemlist = new Itemlist();
Line 111: $itemlist->main_columns = array('Type' => 'type', 'Name' => 'name', 'Added' => 'd');
Line 112: $itemlist->items = $res;
Line 113: $itemlist->addAction('edit', '%ne%');
Line 115: return '<h3>New content</h3>' . $itemlist->render();
Line 145: // Create the itemlist
Line 146: $itemlist = new Itemlist();
Line 147: $itemlist->main_columns = array('Name' => 'name', 'Date modified' => 'date_modified', 'Editor' => 'modified_editor');
Line 148: $itemlist->items = $res;
Line 149: $itemlist->addAction('edit', 'SITE/admin/edit/page/%%#main-tabs-revs');
Line 151: return '<h3>Pages needing approval</h3>' . $itemlist->render();

/sprout/Helpers/Itemlist.php   Highlighted file source

Line 26: class Itemlist
Line 86: $val .= '<input id="itemList-select-all" type="checkbox">';
Line 87: $val .= '<label for="itemList-select-all"><span class="-vis-hidden">Select all</span></label>';
Line 169: $val .= "<input type=\"checkbox\" id=\"itemList-checkbox-{$item['id']}\" name=\"ids[]\" value=\"{$item['id']}\">";
Line 170: $val .= "<label for=\"itemList-checkbox-{$item['id']}\"><span class=\"-vis-hidden\">Select row</span></label>";
Line 279: * $itemlist->setRowClassesFunc(function($row){
Line 293: * Adds an action to this itemlist.
Line 298: * @param string $url Link URL. This URL is processed by {@see Itemlist::urlReplace} during rendering
Line 313: * $itemlist->setActionsClasses('button')
Line 395: * Does this itemlist support checkboxes?
Line 404: * Does this itemlist support ordering?
Line 427: * Renders an itemlist definition

/sprout/tests/encHelperTest.php   Highlighted file source

Line 15: use Sprout\Helpers\Itemlist;
Line 53: $this->assertEquals(Enc::cleanfunky(new Itemlist), '');

/sprout/tests/encHelperTest.php   Highlighted file source

Line 15: use Sprout\Helpers\Itemlist;
Line 53: $this->assertEquals(Enc::cleanfunky(new Itemlist), '');

/sprout/tests/itemlistTest.php   Highlighted file source

Line 16: use Sprout\Helpers\Itemlist;
Line 19: class itemlistTest extends PHPUnit_Framework_TestCase
Line 27: $itemlist = new Itemlist();
Line 28: $itemlist->main_columns = [
Line 31: $itemlist->items = $data;
Line 32: $result = $itemlist->render();
Line 43: $itemlist = new Itemlist();
Line 44: $itemlist->main_columns = [
Line 47: $itemlist->items = $data;
Line 48: $result = $itemlist->render();
Line 58: $itemlist = new Itemlist();
Line 59: $itemlist->main_columns = [
Line 62: $itemlist->items = $data;
Line 63: $result = $itemlist->render();
Line 69: $itemlist = new Itemlist();
Line 70: $itemlist->main_columns = [
Line 73: $itemlist->items = [['id' => 1]];
Line 74: $itemlist->addAction('*aaa*', '*bbb*');
Line 75: $result = $itemlist->render();
Line 82: $itemlist = new Itemlist();
Line 83: $itemlist->main_columns = [
Line 86: $itemlist->items = [['id' => 1]];
Line 87: $itemlist->addAction('*aaa*', '*bbb*', '*ccc*');
Line 88: $result = $itemlist->render();
Line 96: $itemlist = new Itemlist();
Line 97: $itemlist->main_columns = [
Line 100: $itemlist->items = [['id' => 1]];
Line 101: $itemlist->addAction('*shown*', 'Shown', '', function($row){ return true; });
Line 102: $itemlist->addAction('*hidden*', 'Hidden', '', function($row){ return false; });
Line 103: $result = $itemlist->render();
Line 110: $itemlist = new Itemlist();
Line 111: $itemlist->main_columns = [
Line 114: $itemlist->addAggregateColumn('Val', 'sum');
Line 115: $itemlist->items = [['val' => 10], ['val' => 20]];
Line 116: $result = $itemlist->render();
Line 123: $itemlist = new Itemlist();
Line 124: $itemlist->main_columns = [
Line 127: $itemlist->addAggregateColumn('Val', 'sum', new ColModifierMoney('AUS'));
Line 128: $itemlist->items = [['val' => 10], ['val' => 20]];
Line 129: $result = $itemlist->render();
Line 134: $itemlist = new Itemlist();
Line 135: $itemlist->main_columns = [
Line 138: $itemlist->addAggregateColumn('Val', 'count');
Line 139: $itemlist->items = [['val' => 10], ['val' => 10], ['val' => 10]];
Line 140: $result = $itemlist->render();
Line 145: $itemlist = new Itemlist();
Line 146: $itemlist->main_columns = [
Line 149: $itemlist->addAggregateColumn('Val', 'avg');
Line 150: $itemlist->items = [['val' => 10], ['val' => 20]];
Line 151: $result = $itemlist->render();
Line 156: $itemlist = new Itemlist();
Line 157: $itemlist->main_columns = [
Line 160: $itemlist->addAggregateValue('Val', '*agg*');
Line 161: $itemlist->items = [['val' => 10]];
Line 162: $result = $itemlist->render();

/sprout/tests/itemlistTest.php   Highlighted file source

Line 16: use Sprout\Helpers\Itemlist;
Line 19: class itemlistTest extends PHPUnit_Framework_TestCase
Line 27: $itemlist = new Itemlist();
Line 28: $itemlist->main_columns = [
Line 31: $itemlist->items = $data;
Line 32: $result = $itemlist->render();
Line 43: $itemlist = new Itemlist();
Line 44: $itemlist->main_columns = [
Line 47: $itemlist->items = $data;
Line 48: $result = $itemlist->render();
Line 58: $itemlist = new Itemlist();
Line 59: $itemlist->main_columns = [
Line 62: $itemlist->items = $data;
Line 63: $result = $itemlist->render();
Line 69: $itemlist = new Itemlist();
Line 70: $itemlist->main_columns = [
Line 73: $itemlist->items = [['id' => 1]];
Line 74: $itemlist->addAction('*aaa*', '*bbb*');
Line 75: $result = $itemlist->render();
Line 82: $itemlist = new Itemlist();
Line 83: $itemlist->main_columns = [
Line 86: $itemlist->items = [['id' => 1]];
Line 87: $itemlist->addAction('*aaa*', '*bbb*', '*ccc*');
Line 88: $result = $itemlist->render();
Line 96: $itemlist = new Itemlist();
Line 97: $itemlist->main_columns = [
Line 100: $itemlist->items = [['id' => 1]];
Line 101: $itemlist->addAction('*shown*', 'Shown', '', function($row){ return true; });
Line 102: $itemlist->addAction('*hidden*', 'Hidden', '', function($row){ return false; });
Line 103: $result = $itemlist->render();
Line 110: $itemlist = new Itemlist();
Line 111: $itemlist->main_columns = [
Line 114: $itemlist->addAggregateColumn('Val', 'sum');
Line 115: $itemlist->items = [['val' => 10], ['val' => 20]];
Line 116: $result = $itemlist->render();
Line 123: $itemlist = new Itemlist();
Line 124: $itemlist->main_columns = [
Line 127: $itemlist->addAggregateColumn('Val', 'sum', new ColModifierMoney('AUS'));
Line 128: $itemlist->items = [['val' => 10], ['val' => 20]];
Line 129: $result = $itemlist->render();
Line 134: $itemlist = new Itemlist();
Line 135: $itemlist->main_columns = [
Line 138: $itemlist->addAggregateColumn('Val', 'count');
Line 139: $itemlist->items = [['val' => 10], ['val' => 10], ['val' => 10]];
Line 140: $result = $itemlist->render();
Line 145: $itemlist = new Itemlist();
Line 146: $itemlist->main_columns = [
Line 149: $itemlist->addAggregateColumn('Val', 'avg');
Line 150: $itemlist->items = [['val' => 10], ['val' => 20]];
Line 151: $result = $itemlist->render();
Line 156: $itemlist = new Itemlist();
Line 157: $itemlist->main_columns = [
Line 160: $itemlist->addAggregateValue('Val', '*agg*');
Line 161: $itemlist->items = [['val' => 10]];
Line 162: $result = $itemlist->render();

A total of 336 lines in 20 files were found