/** * @param \Sonata\AdminBundle\Admin\AdminInterface $admin * @param array $values * @return \Sonata\AdminBundle\Datagrid\DatagridInterface */ public function getBaseDatagrid(AdminInterface $admin, array $values = array()) { $pager = new Pager(); $pager->setCountColumn($admin->getModelManager()->getIdentifierFieldNames($admin->getClass())); $formBuilder = $this->formFactory->createNamedBuilder('form', 'filter', array(), array('csrf_protection' => false)); return new Datagrid($admin->createQuery(), $admin->getList(), $pager, $formBuilder, $values); }
public function __construct($modPath, $smarty) { parent::__construct($modPath, $smarty); $this->parentPath = $this->tplFilePath . 'header.tpl'; $this->smarty->assign('inh_path', $this->parentPath); $this->sectionString = 'System|Schoolyear'; }
public function __construct($mod_path) { parent::__construct($mod_path); $this->parentPath = $this->tplFilePath . 'fits_header.tpl'; $this->smarty->assign('fitsParent', $this->parentPath); $this->smarty->assign('inh_path', $this->parentPath); }
public function __construct() { if (!isset($_SESSION)) { $this->initEnvironment(); } else { if (!validSession()) { die(_g('The session is invalid, please login again')); } } try { $this->initSmarty(); TableMng::init(); $this->_adminInterface = new AdminInterface(NULL, $this->_smarty); // AdminInterface has used global $smarty, workaround AdminInterface::$smartyHelper = $this->_smarty; $this->_moduleExecutionParser = new ModuleExecutionInputParser(); $this->_moduleExecutionParser->setSubprogramPath('root/administrator'); $this->loadVersion(); $this->initDatabaseConnections(); $this->_logger = new Logger($this->_pdo); $this->_logger->categorySet('Administrator'); $this->_acl = new Acl($this->_logger, $this->_pdo); } catch (MySQLConnectionException $e) { die('Sorry, could not connect to the database.'); } }
public function testExecuteEmptyValidator() { if (interface_exists('Symfony\\Component\\Validator\\Mapping\\MetadataInterface')) { //sf2.5+ $metadata = $this->getMock('Symfony\\Component\\Validator\\Mapping\\MetadataInterface'); } else { $metadata = $this->getMock('Symfony\\Component\\Validator\\MetadataInterface'); } $this->validatorFactory->expects($this->once())->method('getMetadataFor')->with($this->equalTo('Acme\\Entity\\Foo'))->will($this->returnValue($metadata)); $metadata->properties = array(); $metadata->getters = array(); $modelManager = $this->getMock('Sonata\\AdminBundle\\Model\\ModelManagerInterface'); $this->admin->expects($this->any())->method('getModelManager')->will($this->returnValue($modelManager)); // @todo Mock of \Traversable is available since Phpunit 3.8. This should be completed after stable release of Phpunit 3.8. // @see https://github.com/sebastianbergmann/phpunit-mock-objects/issues/103 // $formBuilder = $this->getMock('Symfony\Component\Form\FormBuilderInterface'); // // $this->admin->expects($this->any()) // ->method('getFormBuilder') // ->will($this->returnValue($formBuilder)); $datagridBuilder = $this->getMock('\\Sonata\\AdminBundle\\Builder\\DatagridBuilderInterface'); $this->admin->expects($this->any())->method('getDatagridBuilder')->will($this->returnValue($datagridBuilder)); $listBuilder = $this->getMock('Sonata\\AdminBundle\\Builder\\ListBuilderInterface'); $this->admin->expects($this->any())->method('getListBuilder')->will($this->returnValue($listBuilder)); $command = $this->application->find('sonata:admin:explain'); $commandTester = new CommandTester($command); $commandTester->execute(array('command' => $command->getName(), 'admin' => 'acme.admin.foo')); $this->assertSame(sprintf(str_replace("\n", PHP_EOL, file_get_contents(__DIR__ . '/../Fixtures/Command/explain_admin_empty_validator.txt')), get_class($this->admin), get_class($modelManager), get_class($datagridBuilder), get_class($listBuilder)), $commandTester->getDisplay()); }
function __construct($mod_path) { parent::__construct($mod_path); $this->MOD_HEADING = $this->tplFilePath . 'mod_user_header.tpl'; $this->parentPath = $this->tplFilePath . 'mod_user_header.tpl'; $this->smarty->assign('inh_path', $this->parentPath); $this->smarty->assign('UserParent', $this->MOD_HEADING); }
public function dieMsg($msg) { if ($isFromModule) { parent::dieMsg($msg); } else { die($msg); } }
function __construct($mod_path) { parent::__construct($mod_path); $this->MOD_HEADING = $this->tplFilePath . 'mod_religion_header.tpl'; $this->smarty->assign('ReligionParent', $this->MOD_HEADING); }
<?php include_once '../config.php'; inc_lib('AdminInterface/AdminInterface.php'); $ai = new AdminInterface(); $ai->show();
public function __construct($folder_path) { parent::__construct($folder_path); $this->parentPath = $this->tplFilePath . 'mod_cardchange_header.tpl'; $this->smarty->assign('cardChange', $this->parentPath); }
function __construct($mod_path) { parent::__construct($mod_path); }
public function __construct($folder_path) { parent::__construct($folder_path); $this->parentPath = $this->tplFilePath . 'mod_cardinfo_header.tpl'; $this->smarty->assign('checkoutParent', $this->parentPath); }
function __construct($mod_path) { parent::__construct($mod_path); $this->MOD_HEADING = $this->tplFilePath . 'mod_specialCourse_header.tpl'; $this->smarty->assign('SpecialCourseParent', $this->MOD_HEADING); }
public function __construct($mod_path) { parent::__construct($mod_path); $this->parentPath = $this->tplFilePath . 'header_priceclass.tpl'; $this->smarty->assign('pcParent', $this->parentPath); }
function __construct($mod_path) { parent::__construct($mod_path); $this->MOD_HEADING = $this->tplFilePath . 'mod_schbasSettings_header.tpl'; $this->smarty->assign('schbasSettingsParent', $this->MOD_HEADING); }
<?php $PRJ_DIR = substr($PHP_SELF, 0, strpos($PHP_SELF, "/admin/lib/cron/")); inc_prj("config.php"); inc_lib("AdminInterface/AdminInterface.php"); $ai = new AdminInterface(); $ai->cron("Day");
<?php // */1 * * * * /usr/local/bin/php /home/www/htdocs/lib/cron/min.php > /dev/null // 0 */1 * * * /usr/local/bin/php /home/www/htdocs/lib/cron/hour.php > /dev/null // 0 0 */1 * * /usr/local/bin/php /home/www/htdocs/lib/cron/day.php > /dev/null $PRJ_DIR = substr($PHP_SELF, 0, strpos($PHP_SELF, "/admin/lib/cron/")); inc_prj("config.php"); inc_lib("AdminInterface/AdminInterface.php"); $ai = new AdminInterface(); $ai->cron("Min");
<?php $PRJ_DIR = substr($PHP_SELF, 0, strpos($PHP_SELF, "/admin/lib/cron/")); inc_prj("config.php"); inc_lib("AdminInterface/AdminInterface.php"); $ai = new AdminInterface(); $ai->cron("Hour");
private function configureAdminRequest() { $this->admin->expects($this->once())->method('getRequest')->will($this->returnValue($this->request)); $this->admin->expects($this->once())->method('hasRequest')->will($this->returnValue(true)); }
public function displayDeleteGradeConfirmation($grade) { $infoStr = sprintf($this->languageManager->getText('deleteGradeConfirmationString'), $grade['gradelevel'], $grade['label']); parent::confirmationDialog($infoStr, $this->sectionString, 'deleteGrade&ID=' . $grade['ID'], $this->languageManager->getText('deleteGradeConfirmationYes'), $this->languageManager->getText('deleteGradeConfirmationNo')); }
function __construct($mod_path) { parent::__construct($mod_path); $this->parentPath = $this->tplFilePath . 'header_soli.tpl'; $this->smarty->assign('soliParent', $this->parentPath); }
public function __construct($modPath, $smarty) { parent::__construct($modPath, $smarty); $this->parentPath = $this->tplFilePath . 'header.tpl'; $this->smarty->assign('inh_path', $this->parentPath); }
function __construct($mod_path) { parent::__construct($mod_path); $this->MOD_HEADING = $this->tplFilePath . 'mod_foreignLanguage_header.tpl'; $this->smarty->assign('ForeignLanguageParent', $this->MOD_HEADING); }