Exemplo n.º 1
0
 /**
  * @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);
 }
Exemplo n.º 2
0
 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);
 }
Exemplo n.º 4
0
 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());
 }
Exemplo n.º 6
0
 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);
 }
Exemplo n.º 7
0
 public function dieMsg($msg)
 {
     if ($isFromModule) {
         parent::dieMsg($msg);
     } else {
         die($msg);
     }
 }
Exemplo n.º 8
0
 function __construct($mod_path)
 {
     parent::__construct($mod_path);
     $this->MOD_HEADING = $this->tplFilePath . 'mod_religion_header.tpl';
     $this->smarty->assign('ReligionParent', $this->MOD_HEADING);
 }
Exemplo n.º 9
0
<?php

include_once '../config.php';
inc_lib('AdminInterface/AdminInterface.php');
$ai = new AdminInterface();
$ai->show();
Exemplo n.º 10
0
 public function __construct($folder_path)
 {
     parent::__construct($folder_path);
     $this->parentPath = $this->tplFilePath . 'mod_cardchange_header.tpl';
     $this->smarty->assign('cardChange', $this->parentPath);
 }
Exemplo n.º 11
0
 function __construct($mod_path)
 {
     parent::__construct($mod_path);
 }
Exemplo n.º 12
0
 public function __construct($folder_path)
 {
     parent::__construct($folder_path);
     $this->parentPath = $this->tplFilePath . 'mod_cardinfo_header.tpl';
     $this->smarty->assign('checkoutParent', $this->parentPath);
 }
Exemplo n.º 13
0
 function __construct($mod_path)
 {
     parent::__construct($mod_path);
     $this->MOD_HEADING = $this->tplFilePath . 'mod_specialCourse_header.tpl';
     $this->smarty->assign('SpecialCourseParent', $this->MOD_HEADING);
 }
Exemplo n.º 14
0
 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);
 }
Exemplo n.º 16
0
<?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");
Exemplo n.º 17
0
<?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");
Exemplo n.º 18
0
<?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");
Exemplo n.º 19
0
 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));
 }
Exemplo n.º 20
0
 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'));
 }
Exemplo n.º 21
0
 function __construct($mod_path)
 {
     parent::__construct($mod_path);
     $this->parentPath = $this->tplFilePath . 'header_soli.tpl';
     $this->smarty->assign('soliParent', $this->parentPath);
 }
Exemplo n.º 22
0
 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);
 }