Exemplo n.º 1
0
 public function actionSave()
 {
     if (isset($_GET['id']) && $_GET['id']) {
         $note = Devnote::model()->findByPk($_GET['id']);
     }
     if (!isset($note)) {
         $note = new Devnote();
     }
     $note->attributes = $_GET['Devnote'];
     $note->save(false);
     echo $note->id;
     Yii::app()->end();
 }
Exemplo n.º 2
0
    public function postFilter($filterChain)
    {
        echo '<script>
		devnote.pageId = "' . Devnote::getPageId() . '";
		</script>';
        /** @var $devnotes Devnote[] */
        $devnotes = Devnote::model()->findNotesForCurrentAction();
        $js = '';
        foreach ($devnotes as $key => $value) {
            $js .= 'devnote("' . $value->id . '").init({
				width : "' . $value->width . '",
				height : "' . $value->height . '",
				posX : "' . $value->posX . '",
				posY : "' . $value->posY . '",
				pageId : "' . $value->pageId . '",
				text: "' . $value->text . '"
			});';
        }
        echo '<script>' . $js . '</script>';
    }