public function getReportField()
 {
     $field = parent::getReportField();
     if (class_exists('GridFieldAjaxRefresh')) {
         $field->getConfig()->addComponent(new GridFieldAjaxRefresh(20000, true));
     }
     return $field;
 }
 public function getReportField()
 {
     $field = parent::getReportField();
     $config = $field->getConfig();
     $columns = $config->getComponentByType("GridFieldDataColumns")->getDisplayFields($field);
     $config->getComponentByType('GridFieldExportButton')->setExportColumns($columns);
     return $field;
 }
 function getReportField()
 {
     $tlf = parent::getReportField();
     $tlf->setFieldFormatting(array('Invoice' => '<a target=\\"_blank\\" href=\\"OrderReport_Popup/invoice/$ID\\">' . i18n::_t('VIEW', 'view') . '</a> ' . '<a target=\\"_blank\\" href=\\"OrderReport_Popup/index/$ID?print=1\\">' . i18n::_t('PRINT', 'print') . '</a>'));
     $tlf->setFieldCasting(array('Created' => 'Date->Long', 'Total' => 'Currency->Nice'));
     $tlf->setPermissions(array('edit', 'show', 'export', 'delete', 'print'));
     return $tlf;
 }
 /**
  * Utility method for all tests to use.
  * 
  * @return \ArrayList
  * @todo pre-fill the report with fixture-defined users
  */
 public function setUp()
 {
     parent::setUp();
     $reports = SS_Report::get_reports();
     $report = $reports['UserSecurityReport'];
     $this->report = $report;
     $this->records = $report->sourceRecords()->toArray();
 }
 public function getReportField()
 {
     $gridField = parent::getReportField();
     // Edit CSV export button
     $export_button = $gridField->getConfig()->getComponentByType('GridFieldExportButton');
     $export_button->setExportColumns($this->exportColumns());
     return $gridField;
 }
 /**
  * Test that broken links appears in the reports list
  */
 public function testReportExists()
 {
     $reports = SS_Report::get_reports();
     $reportNames = array();
     foreach ($reports as $report) {
         $reportNames[] = $report->class;
     }
     $this->assertContains('BrokenExternalLinksReport', $reportNames, 'BrokenExternalLinksReport is in reports list');
 }
 public function testAbstractClassesAreExcluded()
 {
     $reports = SS_Report::get_reports();
     $reportNames = array();
     foreach ($reports as $report) {
         $reportNames[] = $report->class;
     }
     $this->assertNotContains('ReportTest_FakeTest_Abstract', $reportNames, 'ReportTest_FakeTest_Abstract is NOT in reports list as it is abstract');
 }
예제 #8
0
 /**
  * Returns the link to the report admin section, or the specific report that is currently displayed
  * @return String
  */
 public function Link($action = null)
 {
     if ($this->reportObject) {
         $link = $this->reportObject->getLink($action);
     } else {
         $link = self::join_links(parent::Link('index'), $action);
     }
     return $link;
 }
 public function setUp()
 {
     parent::setUp();
     if (!class_exists('Subsite')) {
         $this->skipTest = true;
         return $this->markTestSkipped("Please install Subsites to run this test");
     }
     $reports = SS_Report::get_reports();
     $report = $reports['UserSecurityReport'];
     $this->records = $report->sourceRecords()->toArray();
 }
 /**
  * @return ArrayList
  */
 public function UpdatedReportList()
 {
     $output = new ArrayList();
     foreach (SS_Report::get_reports() as $report) {
         if (!in_array(get_class($report), array('SideReport_BrokenFiles'))) {
             if ($report->canView()) {
                 $output->push($report);
             }
         }
     }
     return $output;
 }
 public function getCMSFields()
 {
     Requirements::javascript('externallinks/javascript/BrokenExternalLinksReport.js');
     $fields = parent::getCMSFields();
     $reportResultSpan = '</ br></ br><h3 id="ReportHolder"></h3>';
     $reportResult = new LiteralField('ResultTitle', $reportResultSpan);
     $fields->push($reportResult);
     $button = '<button id="externalLinksReport" type="button">%s</button>';
     $runReportButton = new LiteralField('runReport', sprintf($button, _t('ExternalBrokenLinksReport.RUNREPORT', 'Create new report')));
     $fields->push($runReportButton);
     return $fields;
 }
 /**
  * @return FieldList
  */
 public function getCMSFields()
 {
     Requirements::javascript(SITEWIDE_CONTENT_REPORT . '/javascript/sitewidecontentreport.js');
     $fields = parent::getCMSFields();
     if (class_exists('Subsite')) {
         $subsites = Subsite::all_sites()->map();
         $fields->insertBefore(HeaderField::create('PagesTitle', _t('SitewideContentReport.Pages', 'Pages'), 3), 'Report-Pages');
         $fields->insertBefore(DropdownField::create('AllSubsites', _t('SitewideContentReport.FilterBy', 'Filter by:'), $subsites)->addExtraClass('subsite-filter no-change-track')->setEmptyString('All Subsites'), 'Report-Pages');
     }
     $fields->push(HeaderField::create('FilesTitle', _t('SitewideContentReport.Files', 'Files'), 3));
     $fields->push($this->getReportField('Files'));
     return $fields;
 }
예제 #13
0
//(v2.4) Log errors to an email address
//SS_Log::add_writer(new SS_LogEmailWriter('*****@*****.**'), SS_Log::ERR);
//
//(v2.4) Log errors to a file
//SS_Log::add_writer(new SS_LogFileWriter('error_log.txt'), SS_Log::ERR);
//
/**
 * Extended URL rules for the CMS module
 * 
 * @package cms
 */
Director::addRules(50, array('processes//$Action/$ID/$Batch' => 'BatchProcess_Controller', 'admin/help//$Action/$ID' => 'CMSHelp', 'admin/bulkload//$Action/$ID/$OtherID' => 'BulkLoaderAdmin', 'admin/cms//$Action/$ID/$OtherID' => 'CMSMain', 'PageComment//$Action/$ID' => 'PageComment_Controller', 'dev/buildcache/$Action' => 'RebuildStaticCacheTask'));
CMSMenu::add_director_rules();
// Default CMS HTMLEditorConfig
HtmlEditorConfig::get('cms')->setOptions(array('friendly_name' => 'Default CMS', 'priority' => '50', 'mode' => 'none', 'language' => i18n::get_tinymce_lang(), 'body_class' => 'typography', 'document_base_url' => Director::absoluteBaseURL(), 'urlconverter_callback' => "nullConverter", 'setupcontent_callback' => "sapphiremce_setupcontent", 'cleanup_callback' => "sapphiremce_cleanup", 'use_native_selects' => true, 'valid_elements' => "@[id|class|style|title],#a[id|rel|rev|dir|tabindex|accesskey|type|name|href|target|title|class],-strong/-b[class],-em/-i[class],-strike[class],-u[class],#p[id|dir|class|align|style],-ol[class],-ul[class],-li[class],br,img[id|dir|longdesc|usemap|class|src|border|alt=|title|width|height|align],-sub[class],-sup[class],-blockquote[dir|class],-table[border=0|cellspacing|cellpadding|width|height|class|align|summary|dir|id|style],-tr[id|dir|class|rowspan|width|height|align|valign|bgcolor|background|bordercolor|style],tbody[id|class|style],thead[id|class|style],tfoot[id|class|style],#td[id|dir|class|colspan|rowspan|width|height|align|valign|scope|style],-th[id|dir|class|colspan|rowspan|width|height|align|valign|scope|style],caption[id|dir|class],-div[id|dir|class|align|style],-span[class|align|style],-pre[class|align],address[class|align],-h1[id|dir|class|align|style],-h2[id|dir|class|align|style],-h3[id|dir|class|align|style],-h4[id|dir|class|align|style],-h5[id|dir|class|align|style],-h6[id|dir|class|align|style],hr[class],dd[id|class|title|dir],dl[id|class|title|dir],dt[id|class|title|dir],@[id,style,class]", 'extended_valid_elements' => "img[class|src|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name|usemap],iframe[src|name|width|height|align|frameborder|marginwidth|marginheight|scrolling],object[width|height|data|type],param[name|value],map[class|name|id],area[shape|coords|href|target|alt]"));
HtmlEditorConfig::get('cms')->enablePlugins('media', 'fullscreen');
HtmlEditorConfig::get('cms')->enablePlugins(array('ssbuttons' => '../../../cms/javascript/tinymce_ssbuttons/editor_plugin_src.js'));
HtmlEditorConfig::get('cms')->insertButtonsBefore('formatselect', 'styleselect');
HtmlEditorConfig::get('cms')->insertButtonsBefore('advcode', 'ssimage', 'ssflash', 'sslink', 'unlink', 'anchor', 'separator');
HtmlEditorConfig::get('cms')->insertButtonsAfter('advcode', 'fullscreen', 'separator');
HtmlEditorConfig::get('cms')->removeButtons('tablecontrols');
HtmlEditorConfig::get('cms')->addButtonsToLine(3, 'tablecontrols');
// Register default side reports
SS_Report::register("SideReport", "SideReport_EmptyPages");
SS_Report::register("SideReport", "SideReport_RecentlyEdited");
SS_Report::register("SideReport", "SideReport_ToDo");
if (class_exists('SubsiteReportWrapper')) {
    SS_Report::register('ReportAdmin', 'SubsiteReportWrapper("BrokenLinksReport")', -20);
} else {
    SS_Report::register('ReportAdmin', 'BrokenLinksReport', -20);
}
 function SideReports()
 {
     return SS_Report::get_reports('SideReport');
 }
예제 #15
0
<?php

/**
 *
 * PHP version 5
 *
 * LICENSE: This source file is subject to version 3.01 of the PHP license
 * that is available through the world-wide-web at the following URI:
 * http://www.php.net/license/3_01.txt.  If you did not receive a copy of
 * the PHP License and are unable to obtain it through the web, please
 * send a note to license@php.net so we can mail you a copy immediately.
 *
 * @package   LoggingMailer
 * @author     Nathaniel McHugh <*****@*****.**>
 */
Email::set_mailer(new LoggingMailer());
SS_Report::register('ReportAdmin', 'SentMailReport', -10);
예제 #16
0
 /**
  *	Test the broken links report.
  */
 public function testBrokenLinksReport()
 {
     // ---
     // BROKEN LINKS
     // ---
     // Create a "draft" page with a broken link.
     $page = Page::create();
     $page->Content = "<a href='[sitetree_link,id=987654321]'>This</a> is a broken link.";
     $page->writeToStage('Stage');
     // Retrieve the broken links report.
     $reports = SS_Report::get_reports();
     $brokenLinksReport = null;
     foreach ($reports as $report) {
         if ($report instanceof BrokenLinksReport) {
             $brokenLinksReport = $report;
             break;
         }
     }
     // Determine that the report exists, otherwise it has been excluded.
     if ($brokenLinksReport) {
         // ASSERT that the "draft" report has detected the page having a broken link.
         // ASSERT that the "published" report has NOT detected the page having a broken link, as the page has not been "published" yet.
         $this->isReportBroken($brokenLinksReport, true, false, 'BROKENLINK');
         // Make sure the page is now "published".
         $page->writeToStage('Live');
         // ASSERT that the "draft" report has detected the page having a broken link.
         // ASSERT that the "published" report has detected the page having a broken link.
         $this->isReportBroken($brokenLinksReport, true, true, 'BROKENLINK');
         // Correct the "draft" broken link.
         $page->Content = str_replace('987654321', $page->ID, $page->Content);
         $page->writeToStage('Stage');
         // ASSERT that the "draft" report has NOT detected the page having a broken link.
         // ASSERT that the "published" report has detected the page having a broken link, as the previous content remains "published".
         $this->isReportBroken($brokenLinksReport, false, true, 'BROKENLINK');
         // Make sure the change has now been "published".
         $page->writeToStage('Live');
         // ASSERT that the "draft" report has NOT detected the page having a broken link.
         // ASSERT that the "published" report has NOT detected the page having a broken link.
         $this->isReportBroken($brokenLinksReport, false, false, 'BROKENLINK');
         $page->delete();
         // ---
         // BROKEN FILES
         // ---
         // Create a "draft" page with a broken file.
         $page = Page::create();
         $page->Content = "<a href='[file_link,id=987654321]'>This</a> is a broken file.";
         $page->writeToStage('Stage');
         // ASSERT that the "draft" report has detected the page having a broken file.
         // ASSERT that the "published" report has NOT detected the page having a broken file, as the page has not been "published" yet.
         $this->isReportBroken($brokenLinksReport, true, false, 'BROKENFILE');
         // Make sure the page is now "published".
         $page->writeToStage('Live');
         // ASSERT that the "draft" report has detected the page having a broken file.
         // ASSERT that the "published" report has detected the page having a broken file.
         $this->isReportBroken($brokenLinksReport, true, true, 'BROKENFILE');
         // Correct the "draft" broken file.
         $file = File::create();
         $file->Filename = 'name.pdf';
         $file->write();
         $page->Content = str_replace('987654321', $file->ID, $page->Content);
         $page->writeToStage('Stage');
         // ASSERT that the "draft" report has NOT detected the page having a broken file.
         // ASSERT that the "published" report has detected the page having a broken file, as the previous content remains "published".
         $this->isReportBroken($brokenLinksReport, false, true, 'BROKENFILE');
         // Make sure the change has now been "published".
         $page->writeToStage('Live');
         // ASSERT that the "draft" report has NOT detected the page having a broken file.
         // ASSERT that the "published" report has NOT detected the page having a broken file.
         $this->isReportBroken($brokenLinksReport, false, false, 'BROKENFILE');
         $page->delete();
         // ---
         // BROKEN VIRTUAL PAGES
         // ---
         // Create a "draft" virtual page with a broken link.
         $page = VirtualPage::create();
         $page->CopyContentFromID = 987654321;
         $page->writeToStage('Stage');
         // ASSERT that the "draft" report has detected the page having a broken link.
         // ASSERT that the "published" report has NOT detected the page having a broken link, as the page has not been "published" yet.
         $this->isReportBroken($brokenLinksReport, true, false, 'VPBROKENLINK');
         // Make sure the page is now "published".
         $page->writeToStage('Live');
         // ASSERT that the "draft" report has detected the page having a broken link.
         // ASSERT that the "published" report has detected the page having a broken link.
         $this->isReportBroken($brokenLinksReport, true, true, 'VPBROKENLINK');
         // Correct the "draft" broken link.
         $contentPage = Page::create();
         $contentPage->Content = 'This is some content.';
         $contentPage->writeToStage('Stage');
         $contentPage->writeToStage('Live');
         $page->CopyContentFromID = $contentPage->ID;
         $page->writeToStage('Stage');
         // ASSERT that the "draft" report has NOT detected the page having a broken link.
         // ASSERT that the "published" report has detected the page having a broken link, as the previous content remains "published".
         $this->isReportBroken($brokenLinksReport, false, true, 'VPBROKENLINK');
         // Make sure the change has now been "published".
         $page->writeToStage('Live');
         // ASSERT that the "draft" report has NOT detected the page having a broken link.
         // ASSERT that the "published" report has NOT detected the page having a broken link.
         $this->isReportBroken($brokenLinksReport, false, false, 'VPBROKENLINK');
         $contentPage->delete();
         $page->delete();
         // ---
         // BROKEN REDIRECTOR PAGES
         // ---
         // Create a "draft" redirector page with a broken link.
         $page = RedirectorPage::create();
         $page->RedirectionType = 'Internal';
         $page->LinkToID = 987654321;
         $page->writeToStage('Stage');
         // ASSERT that the "draft" report has detected the page having a broken link.
         // ASSERT that the "published" report has NOT detected the page having a broken link, as the page has not been "published" yet.
         $this->isReportBroken($brokenLinksReport, true, false, 'RPBROKENLINK');
         // Make sure the page is now "published".
         $page->writeToStage('Live');
         // ASSERT that the "draft" report has detected the page having a broken link.
         // ASSERT that the "published" report has detected the page having a broken link.
         $this->isReportBroken($brokenLinksReport, true, true, 'RPBROKENLINK');
         // Correct the "draft" broken link.
         $contentPage = Page::create();
         $contentPage->Content = 'This is some content.';
         $contentPage->writeToStage('Stage');
         $contentPage->writeToStage('Live');
         $page->LinkToID = $contentPage->ID;
         $page->writeToStage('Stage');
         // ASSERT that the "draft" report has NOT detected the page having a broken link.
         // ASSERT that the "published" report has detected the page having a broken link, as the previous content remains "published".
         $this->isReportBroken($brokenLinksReport, false, true, 'RPBROKENLINK');
         // Make sure the change has now been "published".
         $page->writeToStage('Live');
         // ASSERT that the "draft" report has NOT detected the page having a broken link.
         // ASSERT that the "published" report has NOT detected the page having a broken link.
         $this->isReportBroken($brokenLinksReport, false, false, 'RPBROKENLINK');
     }
 }
 /**
  * Return a field, such as a {@link GridField} that is
  * used to show and manipulate data relating to this report.
  *
  * @return FormField subclass
  */
 public function getReportField()
 {
     $gridField = parent::getReportField();
     $gridField->setModelClass('UserSecurityReport');
     $gridConfig = $gridField->getConfig();
     $gridConfig->removeComponentsByType('GridFieldPrintButton');
     $gridConfig->removeComponentsByType('GridFieldExportButton');
     $gridConfig->addComponents(new GridFieldPrintReportButton('buttons-after-left'), new GridFieldExportReportButton('buttons-after-left'));
     return $gridField;
 }
예제 #18
0
 /**
  *	Test the broken redirector pages side report.
  */
 public function testBrokenRedirectorPages()
 {
     // Create a "draft" redirector page with a broken link.
     $page = RedirectorPage::create();
     $page->RedirectionType = 'Internal';
     $page->LinkToID = 987654321;
     $page->writeToStage('Stage');
     // Retrieve the broken redirector pages side report.
     $reports = SS_Report::get_reports();
     $brokenRedirectorPagesReport = null;
     foreach ($reports as $report) {
         if ($report instanceof SideReport_BrokenRedirectorPages) {
             $brokenRedirectorPagesReport = $report;
             break;
         }
     }
     // Determine that the report exists, otherwise it has been excluded.
     if ($brokenRedirectorPagesReport) {
         // ASSERT that the "draft" report has detected the page having a broken link.
         // ASSERT that the "published" report has NOT detected the page having a broken link, as the page has not been "published" yet.
         $this->isReportBroken($brokenRedirectorPagesReport, true, false);
         // Make sure the page is now "published".
         $page->writeToStage('Live');
         // ASSERT that the "draft" report has detected the page having a broken link.
         // ASSERT that the "published" report has detected the page having a broken link.
         $this->isReportBroken($brokenRedirectorPagesReport, true, true);
         // Correct the "draft" broken link.
         $contentPage = Page::create();
         $contentPage->Content = 'This is some content.';
         $contentPage->writeToStage('Stage');
         $contentPage->writeToStage('Live');
         $page->LinkToID = $contentPage->ID;
         $page->writeToStage('Stage');
         // ASSERT that the "draft" report has NOT detected the page having a broken link.
         // ASSERT that the "published" report has detected the page having a broken link, as the previous content remains "published".
         $this->isReportBroken($brokenRedirectorPagesReport, false, true);
         // Make sure the change has now been "published".
         $page->writeToStage('Live');
         // ASSERT that the "draft" report has NOT detected the page having a broken link.
         // ASSERT that the "published" report has NOT detected the page having a broken link.
         $this->isReportBroken($brokenRedirectorPagesReport, false, false);
     }
 }
예제 #19
0
<?php

define('ECOMMERCE_DIR', 'ecommerce');
// Extend the Member with e-commerce related fields.
DataObject::add_extension('Member', 'EcommerceRole');
// Extend Payment with e-commerce relationship.
if (!class_exists('Payment')) {
    user_error("You need to also install the Payment module to use the eCommerce module", E_USER_ERROR);
}
DataObject::add_extension('Payment', 'EcommercePayment');
//create controller for shopping cart
Director::addRules(50, array(ShoppingCart::$URLSegment . '/$Action/$ID/$OtherID' => 'ShoppingCart'));
Object::add_extension("DevelopmentAdmin", "EcommerceDevelopmentAdminDecorator");
DevelopmentAdmin::$allowed_actions[] = 'ecommerce';
//variations
DataObject::add_extension("Product", "ProductVariationDecorator");
Object::add_extension("Product_Controller", "ProductControllerVariationExtension");
//reports
SS_Report::register("SideReport", "EcommerceSideReport_AllProducts");
SS_Report::register("SideReport", "EcommerceSideReport_FeaturedProducts");
SS_Report::register("SideReport", "EcommerceSideReport_NoImageProducts");
예제 #20
0
 **/
//NOTE - if you dont like these URLs then you can change them by adding another rule
// with a higher number.
Director::addRules(50, array('shoppingcart/$Action/$ID/$OtherID/$Version' => 'ShoppingCart_Controller', 'ecommercepayment/$Action/$ID/$OtherID' => 'EcommercePaymentController', 'ecommercetemplatetest/$Action/$ID/$OtherID' => 'EcommerceTemplateTest', 'ecommercebuyabledatalist/$Action/$ID/$OtherID' => 'BuyableSelectField_DataList', 'api/ecommerce/v1' => 'EcommerceRestfulServer'));
Object::add_extension("Member", "EcommerceRole");
Object::add_extension("Payment", "EcommercePayment");
Object::add_extension("SiteTree", "EcommerceSiteTreeExtension");
Object::add_extension("Page_Controller", "EcommerceSiteTreeExtension_Controller");
Object::add_extension("DevelopmentAdmin", "EcommerceDevelopmentAdminDecorator");
DevelopmentAdmin::$allowed_actions[] = 'ecommerce';
SS_Report::register("SideReport", "EcommerceSideReport_FeaturedProducts");
SS_Report::register("SideReport", "EcommerceSideReport_AllProducts");
SS_Report::register("SideReport", "EcommerceSideReport_NoImageProducts");
SS_Report::register("SideReport", "EcommerceSideReport_NoInternalIDProducts");
SS_Report::register("SideReport", "EcommerceSideReport_NoPriceProducts");
SS_Report::register("SideReport", "EcommerceSideReport_NotForSale");
//Object::useCustomClass('Currency','CurrencyImprovements', true);
// copy the lines below to your mysite/_config.php file and set as required.
// __________________________________START ECOMMERCE MODULE CONFIG __________________________________
//The configuration below allows you to customise your ecommerce application -
//Check for the defalt value first rather than setting eveery single config as this requires a lot
//of valuable processing where in many cases the default value is fine.
// * * * DEFINITELY MUST SET
//EcommerceConfig::set_folder_and_file_locations(array("ecommerce/_config/ecommerce.yaml"));
// * * * CMS
//SalesAdmin::add_managed_model("MyOtherLogThing");
//StoreAdmin::add_managed_model("MyOtherLogThing");
//ProductsAndGroupsModelAdmin::add_managed_model("MyOtherLogThing");
// * * * ECOMMERCE I18N SETTINGS NOTES
// * * * for Currency &  Date Formats get this module: http://code.google.com/p/silverstripe-i18n-fieldtypes/
//Object::useCustomClass('Currency','I18nCurrency',true);
<?php

// Add a password complexity validator.
$validator = new PasswordValidator();
// The minimum length may be lowered when required.
$validator->minLength(10);
$validator->characterStrength(2, array('lowercase', 'uppercase', 'digits'));
Member::set_password_validator($validator);
// Remove the duplicate broken link reports.
SS_Report::add_excluded_reports(array('Multisites_SideReport_BrokenLinks', 'Multisites_SideReport_BrokenFiles', 'Multisites_SideReport_BrokenVirtualPages', 'Multisites_SideReport_BrokenRedirectorPages'));
예제 #22
0
 /**
  * @return \FormField
  */
 public function getReportField()
 {
     $compositeField = new \CompositeField();
     foreach ($this->reportModifiers as $reportData) {
         $reportData->modifyReportFieldBefore($compositeField);
     }
     if ($this->dataClass) {
         $field = parent::getReportField();
         if ($field instanceof \GridField) {
             $config = $field->getConfig();
             foreach ($this->reportModifiers as $reportData) {
                 $reportData->modifyGridFieldConfig($config, $field);
             }
         }
         $compositeField->push($field);
     }
     foreach ($this->reportModifiers as $reportData) {
         $reportData->modifyReportFieldAfter($compositeField);
     }
     return $compositeField;
 }
<?php

/**
 * @package silverstripe-multisites
 */
if (!ClassInfo::exists('MultiValueField')) {
    $view = new DebugView();
    $link = 'https://github.com/nyeholt/silverstripe-multivaluefield';
    if (!headers_sent()) {
        header($_SERVER['SERVER_PROTOCOL'] . ' 500 Internal Server Error');
    }
    $view->writeHeader();
    $view->writeInfo('Dependency Error', 'The Multisites module requires the MultiValueField module.');
    $view->writeParagraph("Please install the <a href=\"{$link}\">MultiValueField</a> module.");
    $view->writeFooter();
    exit;
}
if (!defined('MULTISITES_PATH')) {
    define('MULTISITES_PATH', rtrim(basename(dirname(__FILE__))));
}
CMSMenu::remove_menu_item('MultisitesCMSSiteAddController');
CMSMenu::remove_menu_item('MultisitesCMSPageAddController');
LeftAndMain::require_css(MULTISITES_PATH . '/css/MultisitesAdmin.css');
LeftAndMain::require_javascript(MULTISITES_PATH . '/javascript/MultisitesAdmin.js');
SiteTree::set_create_default_pages(false);
// Remove LeftAndMain.AddForm.js - at least until this ticket is resolved
// http://open.silverstripe.org/ticket/7987
Requirements::block(FRAMEWORK_ADMIN_DIR . '/javascript/LeftAndMain.AddForm.js');
SS_Report::add_excluded_reports(array('SideReport_EmptyPages', 'BrokenLinksReport', 'SideReport_RecentlyEdited', 'SideReport_BrokenLinks', 'SideReport_BrokenFiles', 'SideReport_BrokenVirtualPages', 'SideReport_BrokenRedirectorPages'));
 /**
  * Determine if we have reports and need
  * to display the "Reports" main menu item
  * in the CMS.
  *
  * The test for an existance of a report
  * is done by checking for a subclass of
  * "SS_Report" that exists.
  *
  * @return boolean
  */
 public static function has_reports()
 {
     return sizeof(SS_Report::get_reports()) > 0;
 }
    SS_Report::register('ReportAdmin', 'SubsiteReportWrapper("ApprovedPublications3StepReport")', 20);
    SS_Report::register('ReportAdmin', 'SubsiteReportWrapper("UnapprovedDeletions3StepReport")', 20);
    SS_Report::register('ReportAdmin', 'SubsiteReportWrapper("UnapprovedDeletions2StepReport")', 20);
    SS_Report::register('ReportAdmin', 'SubsiteReportWrapper("ApprovedDeletions3StepReport")', 20);
    SS_Report::register('ReportAdmin', 'SubsiteReportWrapper("PagesScheduledForPublishingReport")', 20);
    SS_Report::register('ReportAdmin', 'SubsiteReportWrapper("PagesScheduledForDeletionReport")', 20);
    SS_Report::register('ReportAdmin', 'SubsiteReportWrapper("RecentlyPublishedPagesReport")', 20);
} else {
    SS_Report::register('ReportAdmin', 'UnapprovedPublications3StepReport', 20);
    SS_Report::register('ReportAdmin', 'UnapprovedPublications2StepReport', 20);
    SS_Report::register('ReportAdmin', 'ApprovedPublications3StepReport', 20);
    SS_Report::register('ReportAdmin', 'UnapprovedDeletions3StepReport', 20);
    SS_Report::register('ReportAdmin', 'UnapprovedDeletions2StepReport', 20);
    SS_Report::register('ReportAdmin', 'ApprovedDeletions3StepReport', 20);
    SS_Report::register('ReportAdmin', 'PagesScheduledForPublishingReport', 20);
    SS_Report::register('ReportAdmin', 'PagesScheduledForDeletionReport', 20);
    SS_Report::register('ReportAdmin', 'RecentlyPublishedPagesReport', 20);
}
// Register site reports
// 2 Step
SS_Report::register('SideReport', 'SideReportWrapper("UnapprovedDeletions2StepReport")', 20);
SS_Report::register('SideReport', 'SideReportWrapper("UnapprovedPublications2StepReport")', 20);
SS_Report::register('SideReport', 'MyTwoStepWorkflowRequests', 20);
// 3 Step
SS_Report::register('SideReport', 'SideReportWrapper("ThreeStepMyPublicationRequestsSideReport")', 20);
SS_Report::register('SideReport', 'SideReportWrapper("ThreeStepMyDeletionRequestsSideReport")', 20);
SS_Report::register('SideReport', 'SideReportWrapper("UnapprovedPublications3StepReport")', 20);
SS_Report::register('SideReport', 'SideReportWrapper("ApprovedPublications3StepReport")', 20);
SS_Report::register('SideReport', 'SideReportWrapper("UnapprovedDeletions3StepReport")', 20);
SS_Report::register('SideReport', 'SideReportWrapper("ApprovedDeletions3StepReport")', 20);
예제 #26
0
 public function sourceQuery($params)
 {
     if ($this->baseReport->hasMethod('sourceRecords')) {
         // The default implementation will create a fake query from our sourceRecords() method
         return parent::sourceQuery($params);
     } else {
         if ($this->baseReport->hasMethod('sourceQuery')) {
             $this->beforeQuery($params);
             $query = $this->baseReport->sourceQuery($params);
             $this->afterQuery();
             return $query;
         } else {
             user_error("Please override sourceQuery()/sourceRecords() and columns() in your base report", E_USER_ERROR);
         }
     }
 }
예제 #27
0
<?php

/**
 * The subsites module modifies the behaviour of the CMS - in the SiteTree and Group databases - to store information
 * about a number of sub-sites, rather than a single site.
 */
SiteTree::add_extension('SiteTreeSubsites');
ContentController::add_extension('ControllerSubsites');
CMSPageAddController::add_extension('CMSPageAddControllerExtension');
LeftAndMain::add_extension('LeftAndMainSubsites');
LeftAndMain::add_extension('ControllerSubsites');
Group::add_extension('GroupSubsites');
ErrorPage::add_extension('ErrorPageSubsite');
SiteConfig::add_extension('SiteConfigSubsites');
SS_Report::add_excluded_reports('SubsiteReportWrapper');
//Display in cms menu
SecurityAdmin::add_extension('SubsiteMenuExtension');
CMSMain::add_extension('SubsiteMenuExtension');
CMSPagesController::add_extension('SubsiteMenuExtension');
SubsiteAdmin::add_extension('SubsiteMenuExtension');
CMSSettingsController::add_extension('SubsiteMenuExtension');
CMSMenu::remove_menu_item('SubsiteXHRController');