예제 #1
0
 protected function BODY__SecondHelloWorldView()
 {
     parent::BODY();
     print "<h1>Welcome, to the second view.</h1>";
     print "<p><a href='?'>I'm done here, take me to the first view!</a></p>";
     print "<br /><br /><br />OR<br />";
     print "<p><a href='HelloWorld_03.php'>Continue to Example 03</a></p>";
 }
예제 #2
0
파일: AdminPage.php 프로젝트: zetas/nZEDb
 public function render()
 {
     $this->smarty->assign('page', $this);
     $admin_menu = $this->smarty->fetch('adminmenu.tpl');
     $this->smarty->assign('admin_menu', $admin_menu);
     $this->page_template = 'baseadminpage.tpl';
     parent::render();
 }
예제 #3
0
    protected function BODY()
    {
        parent::BODY();
        ?>

			<h1>Hello World!!!</h1>

		<?php 
    }
예제 #4
0
파일: Page.php 프로젝트: ngdvan/lntguitar
 public function beforeSave()
 {
     if ($this->isNewRecord) {
         $this->create_time = $this->update_time = time();
         $this->user_id = Yii::app()->user->id;
     } else {
         $this->update_time = time();
     }
     return parent::beforeSave();
 }
예제 #5
0
파일: Page.class.php 프로젝트: Gula/magic
 public function save(Doctrine_Connection $conn = null)
 {
     $slug = Magic::slugify($this->getTitle());
     if ($this->isNew()) {
         $i = 0;
         do {
             $i++;
             $q = Doctrine::getTable('Page')->findOneBySlug($slug);
             if (!$q) {
                 break;
             } else {
                 $slug = Magic::slugify($this->getTitle());
                 $slug .= $i;
             }
         } while ($i);
         $this->setSlug($slug);
     } elseif ($slug != $this->getSlug()) {
         $i = 0;
         do {
             $i++;
             $q = Doctrine::getTable('Page')->findOneBySlug($slug);
             if (!$q) {
                 $this->setSlug($slug);
                 break;
             } else {
                 if ($slug == $this->getSlug()) {
                     break;
                 } else {
                     $slug = Magic::slugify($this->getTitle());
                     $slug .= $i;
                 }
             }
         } while ($i);
     }
     parent::save($conn);
     // generamos thumbnails
     $file = sfConfig::get('sf_upload_dir') . '/pictures/' . $this->getPicture();
     if (is_file($file)) {
         $dims = array(array('w' => 950, 'h' => 534), array('w' => 720, 'h' => 405), array('w' => 250, 'h' => 141), array('w' => 60, 'h' => 60));
         $size = getimagesize($file);
         $img = new sfImage($file, $size['mime']);
         if (!is_dir(sfConfig::get('sf_upload_dir') . '/' . $this->get('id'))) {
             mkdir(sfConfig::get('sf_upload_dir') . '/' . $this->get('id'), 0777);
         }
         foreach ($dims as $dim) {
             $img->thumbnail($dim['w'], $dim['h']);
             $img->setQuality(90);
             $img->saveAs(sfConfig::get('sf_upload_dir') . '/' . $this->get('id') . '/img_' . $this->get('id') . '_' . $dim['w'] . 'x' . $dim['h'] . '.jpg');
         }
     }
 }
예제 #6
0
파일: Page.php 프로젝트: kotow/work
 public function delete($con = null)
 {
     try {
         $con = Propel::getConnection();
         $con->begin();
         //deletes generic document
         $genericDocument = Document::getGenericDocument($this);
         $genericDocument->delete();
         parent::delete();
         Document::deleteObjCache($this);
         $con->commit();
         return true;
     } catch (Exception $e) {
         $con->rollback();
         throw $e;
     }
 }
예제 #7
0
    protected function BODY()
    {
        parent::BODY();
        ?>

<h1>Hello World 01!!!</h1>

<p>This is the first Hello World example with the addition of this
	message and using a public constructor, __construct().</p>
<p>
	Also notice that the classname has been changed to 'HelloWorld_01' to
	match the filename of 'HelloWorld_01.php'.<br />If you leave the class
	name as HelloWorld, you will get an error message at the top of your
	screen saying "Classname doesn't match file name".<br />I am also
	calling 'parent::BODY()' in the top of the BODY() function. This is a
	good habit to get into, as when you start using page template, that's
	where the header code will usually be.
</p>
<p>
	<a href='HelloWorld_02.php'>Continue to Example 02</a>
</p>
<?php 
    }
예제 #8
0
 public function __construct()
 {
     parent::__construct();
 }
예제 #9
0
 public static function model($className = __CLASS__)
 {
     return parent::model($className);
 }
예제 #10
0
 /**
  * Returns a peer instance associated with this om.
  *
  * Since Peer classes are not to have any instance attributes, this method returns the
  * same instance for all member of this class. The method could therefore
  * be static, but this would prevent one from overriding the behavior.
  *
  * @return PagePeer
  */
 public function getPeer()
 {
     if (self::$peer === null) {
         self::$peer = new PagePeer();
     }
     return self::$peer;
 }
예제 #11
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getBasePage()
 {
     return $this->hasOne(BasePage::className(), ['id' => 'base_page_id']);
 }
예제 #12
0
파일: Page.php 프로젝트: navid045/maxlaptop
 /**
  * Initializes internal state of Page object.
  * @see        parent::__construct()
  */
 public function __construct()
 {
     // Make sure that parent constructor is always invoked, since that
     // is where any default values for this object are set.
     parent::__construct();
 }
예제 #13
0
파일: Page.php 프로젝트: rapila/cms-base
 protected function moveSubtreeTo($destLeft, $levelDelta, PropelPDO $con = null)
 {
     $oOldParent = $this->getParent($con);
     $oNewParent = PageQuery::create()->filterByTreeLeft($destLeft, Criteria::LESS_THAN)->filterByTreeRight($destLeft, Criteria::GREATER_EQUAL)->filterByTreeLevel($this->getLevel() + $levelDelta - 1)->findOne();
     // Copied from denyable behavior
     if (!(PagePeer::isIgnoringRights() || $this->mayMoveFromTo($oOldParent, $oNewParent))) {
         throw new PropelException(new NotPermittedException("move.custom.pages", array("role_key" => "pages")));
     }
     return parent::moveSubtreeTo($destLeft, $levelDelta, $con);
 }
예제 #14
0
 public function open($method = 'GET', $parameters = [])
 {
     parent::open($method, $parameters);
     return new AddRecipeStep($this->client, $this);
 }
예제 #15
0
 public function open($method = 'DELETE', $parameters = [])
 {
     parent::open($method, $parameters);
     return new CreateRecipe($this->client, $this);
 }
예제 #16
0
파일: Page.php 프로젝트: Jay204/nZEDb
 public function render()
 {
     $this->smarty->assign('page', $this);
     $this->page_template = "basepage.tpl";
     parent::render();
 }
예제 #17
0
파일: Page.php 프로젝트: awecode/awecms
 public function init()
 {
     return parent::init();
 }
예제 #18
0
 public function init()
 {
     parent::init();
 }