public static function addApprovalButton(SkinTemplate &$sktemplate, array &$links) { $title = $sktemplate->getRelevantTitle(); $user = $sktemplate->getUser(); if ($sktemplate->isRevisionCurrent() && ApprovedRevs::isAssignedToProject($title) && ApprovedRevs::userCanApprovePage($title, $user) && !ApprovedRevs::isLatestRevisionApproved($title)) { /* This is somewhat a replication of code from SkinTemplate::buildContentNavigationUrls() */ $onPage = $title->equals($sktemplate->getTitle()); $request = $sktemplate->getRequest(); $action = $request->getVal('action', 'view'); /* /Code Replication */ $isInAction = $onPage && $action == 'approveprojectpage'; $links['actions']['approveprojectpage'] = array('text' => 'אישור הדף', 'href' => $title->getLocalURL('action=approveprojectpage'), 'class' => $isInAction ? 'selected' : ''); } return true; }