public function getTodoList(ImportEvent $event) { $time = time() - $this->config->get(CronJobs::cronKey . '/lastRun', 0); $running = $time < 3600; $todos[] = ['name' => 'Check cron job are running', 'description' => $running ? "" : "Cron daemon is not running properly (ignore during development)", 'status' => $running ? 'complete' : 'incomplete', 'link' => '/admin/cron-jobs']; $event->addContent(['Cron' => $todos]); }
public function adminDashboardPanel(ImportEvent $event) { $dir = realpath(sprintf('%s/../../../', __DIR__)); $dirs = glob("{$dir}/*"); $count = count($dirs) - 1; //ignore framework $panels = [['type' => 'site', 'title' => 'Plugins', 'stats' => "{$count} installed", 'icon' => 'fa-plug', 'priority' => 99, 'href' => '/admin/plugins', 'cta' => 'Get more..', 'bg' => 'bg-aqua']]; $event->addContent($panels); }
public function getTodoList(ImportEvent $event) { $titles = $this->config->get('seo/titles', []); $groups = $this->config->get('groups/groups', []); $todos[] = ['name' => 'Create a "signature" key in public keys', 'description' => 'To use {signature} tag in emails', 'status' => $this->config->get('public/signature') ? 'complete' : 'incomplete', 'link' => '/admin/config']; $todos[] = ['name' => 'Create a "logo_url_dark" key in public keys', 'description' => 'Logo image for white background', 'status' => $this->config->get('public/logo_url_dark') ? 'complete' : 'incomplete', 'link' => '/admin/config']; $todos[] = ['name' => 'Create a "logo_url_light" key in public keys', 'description' => 'Logo image for black background', 'status' => $this->config->get('public/logo_url_light') ? 'complete' : 'incomplete', 'link' => '/admin/config']; $todos[] = ['name' => 'Enable "Minify" plugin to compress js and css', 'description' => 'For faster website loading', 'status' => is_callable(['Minute\\Minify\\Minify', 'minify']) ? 'complete' : 'incomplete', 'link' => '/admin/plugins']; $todos[] = ['name' => 'Install web analytics', 'description' => 'For measuring traffic and advertising ROI', 'status' => !empty($this->config->get('trackers/trackers')) ? 'complete' : 'incomplete', 'link' => '/admin/analytics']; $todos[] = ['name' => 'Setup page titles and descriptions', 'description' => 'Helps improve website SEO', 'status' => !empty($titles['/login']) ? 'complete' : 'incomplete', 'link' => '/admin/page-titles']; $todos[] = ['name' => 'Setup user groups for site', 'description' => 'To control website access', 'status' => is_array($groups) && count($groups) > 1 ? 'complete' : 'incomplete', 'link' => '/admin/user-groups']; $event->addContent(['Admin' => $todos]); }
public function getTodoList(ImportEvent $event) { $logins = ['Twitter', 'Google', 'Facebook']; $providers = $this->config->get('private/auth/providers'); foreach ($logins as $login) { $enabled = false; foreach ($providers as $provider) { if ($provider['name'] === $login) { $enabled = $provider['enabled'] == 'true'; break; } } $todos[] = ['name' => "Enable {$login} login provider", 'status' => $enabled ? 'complete' : 'incomplete', 'link' => '/admin/logins']; if ($enabled) { $todos[] = $this->todoMaker->createManualItem("check-{$login}-login", "Check {$login} login", "Check {$login} login app is working properly", '/login'); } } $todos[] = $this->todoMaker->createManualItem("check-forgot-password-email", "Check forgot password email", 'Check email is being delivered and working properly', '/forgot-password'); $event->addContent(['Authentication' => $todos ?? []]); }
public function getTodoList(ImportEvent $event) { $todos[] = $this->todoMaker->createManualItem("check-opcache-is-working", "Check PHP's OPcache is working", 'Can be ignored during development', '/admin/debug'); $event->addContent(['Debug' => $todos]); }
public function adminLinks(ImportEvent $event) { $links = ['logins' => ['title' => 'Social logins', 'icon' => 'fa-sign-in', 'priority' => 1, 'parent' => 'expert', 'href' => '/admin/logins']]; $event->addContent($links); }
public function compile(ImportEvent $importEvent) { $results = ['constants' => [], 'handlers' => []]; $wildcards = []; foreach (['constants', 'handlers'] as $type) { $e = $type === 'constants'; foreach (['App', 'Minute'] as $dir) { $prefix = $e ? "{$dir}\\Event\\" : "{$dir}\\EventHandler\\"; $dirs = $this->resolver->find($prefix); if (!empty($dirs)) { $finder = new Finder(); $fix = function ($path, $replacement) use($prefix) { return preg_replace('/\\.php$/', '', preg_replace(sprintf('/^.*%s/i', preg_quote($prefix)), $replacement, $path)); }; $files = $finder->depth('< 3')->files()->in($dirs)->name('*.php')->contains($e ? 'const ' : 'function '); foreach ($files as $file) { $classPath = $this->utils->dosPath((string) $file); $classPath = $fix($classPath, $prefix); $basename = $fix($classPath, ''); if ($reflector = new ReflectionClass($classPath)) { if ($e) { foreach ($reflector->getConstants() as $value => $constant) { $parts = explode('.', $constant); for ($i = 0, $j = count($parts) - 1; $i < $j; $i++) { $wildcard = join('.', array_slice($parts, 0, $i + 1)) . '.*'; $wildcards[$wildcard] = ['name' => sprintf('%s', strtr($wildcard, '.', '_')), 'value' => $wildcard, 'group' => 'Wildcard events']; } $results['constants'][] = ['name' => sprintf('%s in %s', $this->utils->filename($value), $basename), 'value' => $constant, 'group' => $parts[0]]; } } else { foreach ($reflector->getMethods(ReflectionMethod::IS_PUBLIC) as $method) { if (!preg_match('/^\\_/', $method->name)) { $value = sprintf("%s@%s", $method->class, $method->name); $parts = explode('\\', $classPath); $results['handlers'][] = ['name' => sprintf('%s@%s', $basename, $method->name), 'value' => $value, 'group' => $parts[2] ?? 'App']; } } } } } } } usort($results[$type], function ($a, $b) { return $a['group'] === $b['group'] ? $a['value'] <=> $b['value'] : $a['group'] <=> $b['group']; }); } usort($wildcards, function ($a, $b) { return $a['value'] <=> $b['value']; }); foreach ($wildcards as $wildcard => $event) { $results['constants'][] = $event; } $importEvent->addContent($results); }
public function adminLinks(ImportEvent $event) { $links = ['cron' => ['title' => 'Cron jobs', 'icon' => 'fa-clock-o', 'priority' => 5, 'parent' => 'expert', 'href' => '/admin/cron-jobs']]; $event->addContent($links); }
public function getTodoList(ImportEvent $event) { $todos[] = ['name' => 'Setup Gmail integration for support desk', 'description' => 'Allows members to update support tickets via email', 'status' => $this->config->get('google/gmail/auth/token/access_token') ? 'complete' : 'incomplete', 'link' => '/admin/gmail/setup']; $todos[] = ['name' => 'Create "support" pages', 'description' => 'Create pages with page type as "support"', 'status' => MPage::where('type', '=', 'support')->where('enabled', '=', 'true')->count() ? 'complete' : 'incomplete', 'link' => '/admin/pages']; $event->addContent(['Support' => $todos]); }
public function adminLinks(ImportEvent $event) { $links = ['todos' => ['title' => 'Todo list', 'icon' => 'fa-list-alt', 'priority' => 3, 'href' => '/admin/todos']]; $event->addContent($links); }
public function adminLinks(ImportEvent $event) { $links = ['dashboard' => ['title' => 'Dashboard', 'href' => '/admin', 'icon' => 'fa-dashboard', 'priority' => 1], 'user-groups' => ['title' => 'User groups', 'icon' => 'fa-users', 'priority' => 2, 'parent' => 'expert', 'href' => '/admin/user-groups'], 'plugins' => ['title' => 'Plugins', 'icon' => 'fa-plug', 'priority' => 999, 'href' => '/admin/plugins'], 'expert' => ['title' => 'Expert users', 'icon' => 'fa-th', 'priority' => 98], 'config' => ['title' => 'Site config', 'icon' => 'fa-cog', 'priority' => 3, 'parent' => 'expert', 'href' => '/admin/config'], 'seo' => ['title' => 'Page titles / SEO', 'icon' => 'fa-search', 'priority' => 4, 'parent' => 'expert', 'href' => '/admin/page-titles'], 'analytics' => ['title' => 'Web analytics', 'icon' => 'fa-area-chart', 'priority' => 9, 'parent' => 'expert', 'href' => '/admin/analytics'], 'event-manager' => ['title' => 'Events manager', 'icon' => 'fa-magnet', 'priority' => 99, 'parent' => 'expert', 'href' => '/admin/events']]; $event->addContent($links); }
public function adminLinks(ImportEvent $event) { $links = ['minify' => ['title' => 'Minify', 'icon' => 'fa-compress', 'priority' => 70, 'parent' => 'expert', 'href' => '/admin/minify']]; $event->addContent($links); }
public function getTodoList(ImportEvent $event) { $todos[] = ['name' => "Create autoresponder campaign", 'description' => 'An autoresponder campaign and at least 3 follow-up messages', 'status' => MArMessage::count() > 2 ? 'complete' : 'incomplete', 'link' => '/admin/autoresponder/campaigns']; $todos[] = ['name' => "Create mailing lists", 'description' => 'At least two different mailing list targets', 'status' => MArList::count() >= 2 ? 'complete' : 'incomplete', 'link' => '/admin/autoresponder/lists']; $event->addContent(['Autoresponder' => $todos]); }
public function adminDashboardPanel(ImportEvent $event) { $count = MSupportTicket::where('state', '=', 'open')->count(); $panels = [['type' => 'site', 'title' => 'Support', 'stats' => "{$count} open", 'icon' => 'fa-life-bouy', 'priority' => 3, 'href' => '/admin/support/tickets/open', 'cta' => 'View tickets..']]; $event->addContent($panels); }
public function getTodoList(ImportEvent $event) { $todos[] = ['name' => 'Enable minifier for CSS', 'description' => '', 'status' => $this->config->get('minify/css/files') ? 'complete' : 'incomplete', 'link' => '/admin/minify']; $todos[] = ['name' => 'Enable minifier for Javascript', 'description' => '', 'status' => $this->config->get('minify/js/files') ? 'complete' : 'incomplete', 'link' => '/admin/minify']; $event->addContent(['Minifier' => $todos]); }
public function adminLinks(ImportEvent $event) { $links = ['debug' => ['title' => 'Debug tools', 'icon' => 'fa-code', 'priority' => 98, 'parent' => 'expert', 'href' => '/admin/debug']]; $event->addContent($links); }
public function adminLinks(ImportEvent $event) { $links = ['autoresponder' => ['title' => 'Auto responders', 'icon' => 'fa-retweet', 'priority' => 2, 'parent' => 'mails', 'href' => '/admin/autoresponder/campaigns'], 'broadcast' => ['title' => 'Broadcasts', 'icon' => 'fa-bullhorn', 'priority' => 3, 'parent' => 'mails', 'href' => '/admin/autoresponder/broadcast'], 'mailingList' => ['title' => 'Mailing Lists', 'icon' => 'fa-list', 'priority' => 4, 'parent' => 'mails', 'href' => '/admin/autoresponder/lists']]; $event->addContent($links); }
public function memberLinks(ImportEvent $event) { $links = ['member-support' => ['title' => "Help & Support", 'icon' => 'fa-life-buoy', 'priority' => 80], 'member-support-desk' => ['title' => "Support desk", 'icon' => 'fa-question-circle', 'priority' => 1, 'parent' => 'member-support', 'href' => '/members/support']]; $event->addContent($links); }