<?php /** @noinspection PhpUnused */
/***********************************************************************
| Cerb(tm) developed by Webgroup Media, LLC.
|-----------------------------------------------------------------------
| All source code & content (c) Copyright 2002-2019, Webgroup Media LLC
|   unless specifically noted otherwise.
|
| This source code is released under the Devblocks Public License.
| The latest version of this license can be found here:
| http://cerb.ai/license
|
| By using this software, you acknowledge having read this license
| and agree to be bound thereby.
| ______________________________________________________________________
|	http://cerb.ai	    http://webgroup.media
***********************************************************************/

class PageSection_SetupDevelopersReferenceIcons extends Extension_PageSection {
	static function getIcons($limit=null, $page=0, $filter=null, &$paging=[]) {
		$icons = [
			'activity',
			'address-book',
			'adjust',
			'adjust-alt',
			'airplane',
			'alarm',
			'albums',
			'alert',
			'align-center',
			'align-left',
			'align-right',
			'anchor',
			'asterisk',
			'atv-vehicle',
			'ax',
			'baby-formula',
			'ban',
			'bank',
			'barcode',
			'baseball',
			'basketball',
			'bath-bathtub',
			'bath-shower',
			'bathrobe',
			'beach-umbrella',
			'bed',
			'bed-alt',
			'beer',
			'bell',
			'bicycle',
			'bin',
			'binoculars',
			'birthday-cake',
			'bishop',
			'bitcoin',
			'blackboard',
			'blacksmith',
			'blog',
			'bluetooth',
			'boat',
			'bold',
			'bomb',
			'book',
			'book-open',
			'bookmark',
			'bowling',
			'briefcase',
			'brightness-increase',
			'brightness-reduce',
			'bring-forward',
			'bring-to-front',
			'brush',
			'bucket',
			'bug',
			'building',
			'bullets',
			'bullhorn',
			'buoy',
			'bus',
			'cake',
			'calculator',
			'calendar',
			'camera',
			'camera-small',
			'candle',
			'car',
			'car-hov',
			'car-rental',
			'car-wheel',
			'cardio',
			'cargo',
			'cars',
			'cart-in',
			'cart-out',
			'cart-tick',
			'cat',
			'cd',
			'celebration',
			'certificate',
			'charging-station',
			'charts',
			'chat',
			'check',
			'chevron-down',
			'chevron-left',
			'chevron-right',
			'chevron-up',
			'child',
			'circle-arrow-down',
			'circle-arrow-left',
			'circle-arrow-right',
			'circle-arrow-top',
			'circle-exclamation-mark',
			'circle-info',
			'circle-minus',
			'circle-ok',
			'circle-plus',
			'circle-question-mark',
			'circle-remove',
			'classic-hammer',
			'claw-hammer',
			'cleaning',
			'clock',
			'cloud',
			'cloud-download',
			'cloud-minus',
			'cloud-plus',
			'cloud-upload',
			'cluster',
			'coat-hanger',
			'coffee-cup',
			'cogwheel',
			'cogwheels',
			'coins',
			'collapse',
			'collapse-top',
			'comments',
			'commodities',
			'compass',
			'compressed',
			'construction-cone',
			'conversation',
			'copy',
			'copyright-mark',
			'credit-card',
			'crop',
			'crown',
			'cup',
			'currency-conversion',
			'cutlery',
			'dashboard',
			'database',
			'database-ban',
			'database-lock',
			'database-minus',
			'database-plus',
			'database-search',
			'delete',
			'dining-set',
			'direction',
			'disk-export',
			'disk-import',
			'disk-open',
			'disk-remove',
			'disk-save',
			'disk-saved',
			'display',
			'divide',
			'dog',
			'down-arrow',
			'download',
			'download-alt',
			'dress',
			'drink',
			'dumbbell',
			'duplicate',
			'ear-plugs',
			'earphone',
			'edit',
			'education',
			'eject',
			'electrical-plug',
			'electrical-socket-eu',
			'electrical-socket-us',
			'electricity',
			'embed',
			'embed-close',
			'envelope',
			'equalizer',
			'erase',
			'euro',
			'exit',
			'expand',
			'eye-close',
			'eye-minus',
			'eye-open',
			'eye-plus',
			'eyedropper',
			'fabric',
			'facetime-video',
			'factory',
			'family',
			'fast-backward',
			'fast-food',
			'fast-forward',
			'fax',
			'female',
			'file',
			'file-export',
			'file-import',
			'film',
			'filter',
			'fins',
			'fire',
			'firework',
			'fishes',
			'fit-frame-to-image',
			'fit-image-to-frame',
			'flag',
			'flash',
			'floppy-disk',
			'floppy-open',
			'floppy-remove',
			'floppy-save',
			'floppy-saved',
			'flowchart',
			'flower',
			'folder-closed',
			'folder-flag',
			'folder-heart',
			'folder-lock',
			'folder-minus',
			'folder-new',
			'folder-open',
			'folder-plus',
			'font',
			'forward',
			'french-press',
			'fullscreen',
			'gamepad',
			'gas-station',
			'gbp',
			'gift',
			'girl',
			'git-branch',
			'git-commit',
			'git-compare',
			'git-create',
			'git-delete',
			'git-merge',
			'git-private',
			'git-pull-request',
			'glass',
			'glasses',
			'global',
			'globe',
			'globe-af',
			'golf',
			'golf-course',
			'google-maps',
			'grater',
			'group',
			'hand-down',
			'hand-left',
			'hand-right',
			'hand-saw',
			'hand-up',
			'handshake',
			'hazard',
			'hazard-sign',
			'hdd',
			'header',
			'headphones',
			'headset',
			'heart',
			'heart-empty',
			'heat',
			'history',
			'hockey',
			'home',
			'hospital',
			'hospital-h',
			'hotspot',
			'hourglass',
			'hygiene-kit',
			'ice-cream',
			'ice-cream-no',
			'ice-lolly',
			'ice-lolly-tasted',
			'imac',
			'inbox',
			'inbox-in',
			'inbox-lock',
			'inbox-minus',
			'inbox-out',
			'inbox-plus',
			'invoice',
			'ipad',
			'iphone',
			'iphone-exchange',
			'iphone-shake',
			'iphone-transfer',
			'ipod',
			'ipod-shuffle',
			'italic',
			'justify',
			'kettle',
			'keyboard-wired',
			'keyboard-wireless',
			'keynote',
			'keys',
			'king',
			'kiosk',
			'kiosk-food',
			'kiosk-light',
			'kiosk-wheels',
			'knight',
			'lab',
			'lab-alt',
			'lamp',
			'leaf',
			'leather',
			'left-arrow',
			'left-indent',
			'life-preserver',
			'lightbulb',
			'link',
			'list',
			'list-alt',
			'lock',
			'log-book',
			'log-in',
			'log-out',
			'luggage',
			'macbook',
			'magic',
			'magnet',
			'male',
			'map',
			'marriage',
			'medicine',
			'menu-hamburger',
			'message-ban',
			'message-empty',
			'message-flag',
			'message-forward',
			'message-full',
			'message-in',
			'message-lock',
			'message-minus',
			'message-new',
			'message-out',
			'message-plus',
			'mic-mute',
			'microphone',
			'minus',
			'mms',
			'modal-window',
			'money',
			'moon',
			'more',
			'more-items',
			'more-windows',
			'mosquito-net',
			'motorcycle',
			'move',
			'multiple-displays',
			'music',
			'mute',
			'nails',
			'nameplate',
			'nameplate-alt',
			'new-window',
			'new-window-alt',
			'newspaper',
			'none-color-swatch',
			'note',
			'notes',
			'notes-2',
			'ok',
			'ok-2',
			'old-man',
			'option-horizontal',
			'option-vertical',
			'oxygen-bottle',
			'package',
			'pants',
			'paperclip',
			'paragraph',
			'parents',
			'paste',
			'pause',
			'pawn',
			'pen',
			'pencil',
			'person',
			'person-running',
			'person-walking',
			'person-wheelchair',
			'phone-alt',
			'piano',
			'picture',
			'pie-chart',
			'piggy-bank',
			'pin',
			'pin-flag',
			'pipe',
			'pizza',
			'plate-of-food',
			'play',
			'play-button',
			'playing-dices',
			'playlist',
			'plus',
			'podcast',
			'podium',
			'pool',
			'pot',
			'power',
			'print',
			'projector',
			'pushpin',
			'qrcode',
			'queen',
			'quote',
			'rabbit',
			'radar',
			'random',
			'record',
			'redo',
			'refresh',
			'registration-mark',
			'remote-control',
			'remote-control-tv',
			'remove',
			'remove-2',
			'repeat',
			'resize-full',
			'resize-small',
			'restart',
			'retweet',
			'retweet-2',
			'rewind',
			'riflescope',
			'right-arrow',
			'right-indent',
			'ring',
			'road',
			'rotation-lock',
			'roundabout',
			'router',
			'ruble',
			'rugby',
			'ruler',
			'sampler',
			'saw-blade',
			'scale',
			'scale-classic',
			'scissors',
			'scissors-alt',
			'screenshot',
			'scuba-diving',
			'search',
			'security-camera',
			'send',
			'send-backward',
			'send-to-back',
			'server',
			'server-ban',
			'server-flag',
			'server-lock',
			'server-minus',
			'server-new',
			'server-plus',
			'settings',
			'share',
			'share-alt',
			'sheriffs-star',
			'shield',
			'shirt',
			'shoe-steps',
			'shoes',
			'shop',
			'shop-window',
			'shopping-bag',
			'shopping-cart',
			'show-big-thumbnails',
			'show-lines',
			'show-thumbnails',
			'show-thumbnails-with-lines',
			'shower',
			'shredder',
			'signal',
			'skateboard',
			'skull',
			'smoking',
			'sms',
			'snorkel-diving',
			'snowflake',
			'soccer-ball',
			'sort',
			'sort-by-alphabet',
			'sort-by-alphabet-alt',
			'sort-by-attributes',
			'sort-by-attributes-alt',
			'sort-by-order',
			'sort-by-order-alt',
			'sorting',
			'sound-5-1',
			'sound-6-1',
			'sound-7-1',
			'sound-dolby',
			'sound-stereo',
			'spade',
			'speakers',
			'spray',
			'star',
			'star-empty',
			'star-half',
			'stats',
			'step-backward',
			'step-forward',
			'stethoscope',
			'stop',
			'stop-sign',
			'stopwatch',
			'stroller',
			'subscript',
			'subtitles',
			'suitcase',
			'sun',
			'sunglasses',
			'superscript',
			'sweater',
			't-shirt',
			'table',
			'table-tennis',
			'tablet',
			'tag',
			'tags',
			'target',
			'taxi',
			'tea-kettle',
			'temple-buddhist',
			'temple-christianity-church',
			'temple-hindu',
			'temple-islam',
			'tent',
			'text-background',
			'text-bigger',
			'text-color',
			'text-height',
			'text-resize',
			'text-size',
			'text-smaller',
			'text-strike',
			'text-underline',
			'text-width',
			'thumbs-down',
			'thumbs-up',
			'tie',
			'tint',
			'tower',
			'tractor',
			'train',
			'transfer',
			'translate',
			'transport',
			'tree-conifer',
			'tree-deciduous',
			'truck',
			'turtle',
			'tv',
			'uk-rat-12',
			'uk-rat-12a',
			'uk-rat-15',
			'uk-rat-18',
			'uk-rat-pg',
			'uk-rat-r18',
			'uk-rat-u',
			'umbrella',
			'unchecked',
			'underground',
			'underwear',
			'undo',
			'unlock',
			'unshare',
			'up-arrow',
			'upload',
			'us-rat-g',
			'us-rat-no-one-17',
			'us-rat-pg',
			'us-rat-pg-13',
			'us-rat-restricted',
			'usd',
			'user',
			'user-add',
			'user-alert',
			'user-asterisk',
			'user-ban',
			'user-conversation',
			'user-flag',
			'user-key',
			'user-lock',
			'user-remove',
			'vases',
			'vcard',
			'vector-path-all',
			'vector-path-circle',
			'vector-path-curve',
			'vector-path-line',
			'vector-path-polygon',
			'vector-path-square',
			'video-hd',
			'video-sd',
			'voice',
			'voicemail',
			'volume-down',
			'volume-up',
			'wallet',
			'warning-sign',
			'watch',
			'webcam',
			'wifi',
			'wifi-alt',
			'woman',
			'wrench',
			'yen',
			'zoom-in',
			'zoom-out',
		];
		
		if($filter) {
			$icons = array_filter($icons, function($icon) use ($filter) {
				return stristr($icon, $filter);
			});
		}
		
		if($limit) {
			$total = count($icons);
			
			$icons = array_splice($icons, $page*$limit, $limit);
			
			$paging = DevblocksPlatform::services()->data()->generatePaging($icons, $total, $limit, $page);
		}
		
		return $icons;
	}
	
	function render() {
		$visit = CerberusApplication::getVisit();
		$tpl = DevblocksPlatform::services()->template();
		$response = DevblocksPlatform::getHttpResponse();
		$active_worker = CerberusApplication::getActiveWorker();
		
		if(!$active_worker || !$active_worker->is_superuser)
			DevblocksPlatform::dieWithHttpError(null, 403);
		
		$stack = $response->path;
		
		@array_shift($stack); // config
		@array_shift($stack); // reference_icons
		
		$visit->set(ChConfigurationPage::ID, 'reference_icons');
		
		$icons = self::getIcons();
		
		$tpl->assign('icons', $icons);
		
		$tpl->display('devblocks:cerberusweb.core::configuration/section/developers/reference/icons/index.tpl');
	}
	
	function handleActionForPage(string $action, string $scope=null) {
		return false;
	}
}