<?php
function GetSharepointTopSitesTableHeaders
(bool
$DisplayExpandedWidget=false) : array {
$return = [
// Name, Sortable
'Site' => false,
'Visitors' => 'visitors',
'Visits' => 'visits',
'Score' => 'score',
'Last Updated' => 'last_modified',
];
if ($DisplayExpandedWidget === true) {
$return['Created'] = 'created_at';
}
return $return;
}
var_dump(GetSharepointTopSitesTableHeaders
(true));
PD9waHAKCmZ1bmN0aW9uIEdldFNoYXJlcG9pbnRUb3BTaXRlc1RhYmxlSGVhZGVycyhib29sICREaXNwbGF5RXhwYW5kZWRXaWRnZXQ9ZmFsc2UpIDogYXJyYXkKICAgIHsKICAgICAgICAkcmV0dXJuID0gWwogICAgICAgICAgICAvLyBOYW1lLCBTb3J0YWJsZQogICAgICAgICAgICAnU2l0ZScgICAgICAgICAgPT4gZmFsc2UsCiAgICAgICAgICAgICdWaXNpdG9ycycgICAgICA9PiAndmlzaXRvcnMnLAogICAgICAgICAgICAnVmlzaXRzJyAgICAgICAgPT4gJ3Zpc2l0cycsCiAgICAgICAgICAgICdTY29yZScgICAgICAgICA9PiAnc2NvcmUnLAogICAgICAgICAgICAnTGFzdCBVcGRhdGVkJyAgPT4gJ2xhc3RfbW9kaWZpZWQnLAogICAgICAgIF07CgogICAgICAgIGlmICgkRGlzcGxheUV4cGFuZGVkV2lkZ2V0ID09PSB0cnVlKSB7CiAgICAgICAgICAgICRyZXR1cm5bJ0NyZWF0ZWQnXSA9ICdjcmVhdGVkX2F0JzsKICAgICAgICB9CgogICAgICAgIHJldHVybiAkcmV0dXJuOwogICAgfQogICAgCiAgICB2YXJfZHVtcChHZXRTaGFyZXBvaW50VG9wU2l0ZXNUYWJsZUhlYWRlcnModHJ1ZSkpOw==