Exemplo n.º 1
0
 /**
  * Initializes the pager by setting some default property values.
  * @param string $html
  * @param string $title
  * @param mixed $format
  * @param string $orientation
  */
 public function __construct($html, $title = '', $format = 'A4', $orientation = 'P')
 {
     parent::__construct($this->mode, $format, $this->defaultFontSize, $this->defaultFont, $this->marginLeft, $this->marginRight, $this->marginTop, $this->marginBottom, $this->marginHeader, $this->marginFooter, $orientation);
     $controller = new CController('PDF');
     $controller->layout = $this->layouts;
     $html = $controller->renderText($html, true);
     $this->SetCreator($this->creator);
     $this->SetTitle($title);
     if (!UserWeb::instance()->isGuest) {
         $this->SetFooter(sprintf('Berkas dicetak oleh %s, %s||{PAGENO}', UserWeb::instance()->user()->username, date('Y-m-d H:i:s')));
     } else {
         throw new CHttpException(403, 'Anda tidak memiliki otoritas untuk mengakses halaman ini');
     }
     $this->writeHTML($html);
 }
 /**
  * Ask the System whether the current user is still authenticated for
  * using this system. It will check the timeout expiration
  */
 public function actionAsk()
 {
     header('Content-type: application/json');
     $json = array('isTimeout' => UserWeb::instance()->isGuest);
     if ($json['isTimeout']) {
         $json['backURL'] = $this->createUrl('/parser/authenticate/login');
     }
     echo CJSON::encode($json);
 }
 /**
  * Retrieve solutions based on given string ID
  * @param string $stringsID list of ID of range of ID unified by a string.
  *                          eg. 1,2,4-5,22
  * @return \CorpusParseTreeSolution[]
  */
 protected function retrieveSolutionsByStringID($stringsID)
 {
     $userWeb = UserWeb::instance();
     $user = $userWeb->user();
     /* @var $user User */
     $solutions = [];
     foreach ($stringsID as $stringID) {
         $solution = CorpusParseTreeSolution::model()->findByPk($stringID);
         if ($solution) {
             $solutions[] = $solution;
         }
     }
     return $solutions;
 }
            <?php 
        }
        ?>

            <a class="pull-right action-save" method="context">
                <i class="glyphicon glyphicon-open" data-toggle="tooltip" title="Simpan berkas ini" data-placement="left"></i>
                &nbsp;
            </a>
        <?php 
    }
    ?>


        <a class="content">
            <?php 
    if (UserWeb::instance()->isModerator()) {
        ?>
                <span class="label-document-ID">
                    Kalimat (ID <?php 
        echo $document->ID;
        ?>
)
                    <br/>
                </span>
            <?php 
    }
    ?>
            <span class="content-string">
                <?php 
    echo $this->userSolution($document) ? $this->userSolution($document)->sentence : $document->sentence;
    ?>
 /**
  * Initialize toastr.js message on beforeRender
  * @param string $view view
  * @return boolean render success status
  */
 public function beforeRender($view)
 {
     if (UserWeb::instance()->hasMessage()) {
         $this->renderJS([], array('message' => array('status' => UserWeb::instance()->getMessageStatus(), 'content' => UserWeb::instance()->getMessageContent())));
     }
     $this->renderJS(['authenticationURL' => $this->createUrl('/parser/authenticate/ask')], []);
     return parent::beforeRender($view);
 }
Exemplo n.º 6
0
 /**
  * Get user identity
  * @return string
  */
 protected function getIdentityName()
 {
     return substr(!UserWeb::instance()->isGuest ? UserWeb::instance()->user()->username : '******', 0, 20);
 }
 /**
  * Initialize toastr.js message on beforeRender
  * @param string $view view
  * @return boolean render success status
  */
 public function beforeRender($view)
 {
     if (UserWeb::instance()->hasMessage()) {
         $this->renderJS(array(), array('message' => array('status' => UserWeb::instance()->getMessageStatus(), 'content' => UserWeb::instance()->getMessageContent())));
     }
     return parent::beforeRender($view);
 }
                    </legend>
                </fieldset>
            </div>
        </div>
    </section>

    <section class="content-section section-option text-center" style="padding-top: 10px !important; padding-right: 10px">
        <div class="row">  
            <div id="svg-wrapper" class="col-md-12" style="overflow: scroll; height: 600px; ">
                <svg id="svg-canvas" class="display" width="2000" height="600"></svg>
            </div>
        </div>
    </section>

    <section class="content-section text-center <?php 
echo UserWeb::instance()->id !== 1 ? 'hidden' : '';
?>
" style="padding-top: 10px !important;">
        <button class="btn btn-default show-bracket">
            <h5>
                Tampilan Bracket
            </h5>
        </button>
        <pre class="panel-bracket"></pre>
        <div class="panel-debug text-left">

        </div>
    </section>
</div>
<script type="text/javascript" src="<?php 
echo $this->createUrl("/scripts/tree/manage-allstring.js");
Exemplo n.º 9
0
 /**
  * to checks whether the User is Common User or not
  * @return boolean true if user is Common User, false otherwise
  */
 public function isUser()
 {
     $user = $this->loadUser();
     return $user && !UserWeb::instance()->isGuest;
 }