Beispiel #1
0
 /**
  * REnder submit button
  * @return boolean
  */
 public function renderSubmitButton()
 {
     $cancelId = 'cancelButton' . $this->getHtmlId();
     if ($this->hasEntity()) {
         if ($this->_entity instanceof \Zbase\Post\PostInterface) {
             $postAction = $this->_v('post.action', $this->_action);
             $cancelId = 'formCancelButton' . ucfirst($postAction) . $this->entity()->postHtmlId();
         }
         if (empty($this->_entityIsDefault) && $this->_entity->hasSoftDelete() && $this->_entity->trashed()) {
             if ($this->_action == 'restore') {
                 return '<button onclick="window.history.back();" type="button" class="btn">Cancel</button>&nbsp;<button type="submit" class="btn btn-info">Restore</button>';
             }
             if ($this->_action == 'ddelete') {
                 return '<button onclick="window.history.back();" type="button" class="btn">Not Now</button>&nbsp;<button type="submit" class="btn btn-danger">Delete Forever</button>';
             }
             return '';
         }
     }
     $attributes = $this->_v('submit.button.' . $this->_action . '.html.attributes', $this->_v('submit.button.html.attributes', []));
     $attributes['class'][] = 'btn btn-success';
     $cancel = $this->_v('submit.button.' . $this->_action . '.cancel', $this->_v('submit.button.cancel', false));
     //		$cancelOnclick = $this->_v('submit.button.' . $this->_action . '.cancel.onclick', true);
     $cancelButton = null;
     if (!empty($cancel)) {
         if (is_array($cancel)) {
             if (!empty($cancel['route'])) {
                 $cancelUrl = zbase_url_from_config($cancel);
             }
         }
         $cancelAttributes['class'][] = 'btn';
         $cancelAttributes = $this->_v('submit.button.' . $this->_action . '.cancel.html.attributes.input', $this->_v('submit.button.cancel.html.attributes.input', false));
         $cancelLabel = $this->_v('submit.button.' . $this->_action . '.cancel.label', $this->_v('submit.button.cancel.label', 'Cancel'));
         if (is_array($cancelAttributes['class'])) {
             if (!in_array('btn', $cancelAttributes['class'])) {
                 $cancelAttributes['class'][] = 'btn btn-danger';
             }
         } else {
             $cancelAttributes['class'][] = 'btn btn-danger';
         }
         if (!empty($cancelUrl)) {
             $cancelButton = '<a id="' . $cancelId . '" href="' . $cancelUrl . '" ' . $this->renderHtmlAttributes($cancelAttributes) . '>' . $cancelLabel . '</a>';
         } else {
             $cancelButton = '<button id="' . $cancelId . '" type="button" ' . $this->renderHtmlAttributes($cancelAttributes) . '>' . $cancelLabel . '</button>';
         }
     }
     if (zbase_is_angular_template()) {
         if (!empty($this->_validationRules)) {
             return $cancelButton . '&nbsp;<button ng-disabled="' . $this->getHtmlId() . '.$invalid" class="btn btn-success" ' . $this->renderHtmlAttributes($attributes) . '>' . $this->submitButtonLabel() . '</button>';
         }
         return $cancelButton . '&nbsp;<button id="submitButton' . $this->getHtmlId() . '" class="btn btn-success" ' . $this->renderHtmlAttributes($attributes) . '>' . $this->submitButtonLabel() . '</button>';
     }
     return $cancelButton . '&nbsp;<button id="submitButton' . $this->getHtmlId() . '" type="submit" ' . $this->renderHtmlAttributes($attributes) . '>' . $this->submitButtonLabel() . '</button>';
 }
Beispiel #2
0
 /**
  * Generate URL
  * @return type
  */
 public function getRouteUrl()
 {
     if (!empty($this->route)) {
         if ($this->isAngular()) {
             return zbase_angular_url($this->route);
         }
         return zbase_url_from_config(['route' => $this->route]);
     }
     return '#';
 }
    ?>
		<?php 
    foreach ($breadcrumbs as $breadcrumb) {
        ?>
			<?php 
        $counter++;
        ?>
			<?php 
        $config = zbase_config_get('nav.front.main.' . $breadcrumb, []);
        ?>
			<?php 
        if (!empty($config)) {
            ?>
				<?php 
            $route = !empty($config['url']) ? $config['url'] : (!empty($config['link']) ? $config['link'] : null);
            $url = zbase_url_from_config($route);
            $label = zbase_value_get($config, 'label', null);
            $title = zbase_value_get($config, 'title', null);
            ?>
				<li class="<?php 
            echo $counter == count($breadcrumbs) ? 'last' : null;
            ?>
">
					<a href="<?php 
            echo $url;
            ?>
" title="<?php 
            echo $title;
            ?>
"><?php 
            echo $label;
		<?php 
    $breadcrumbs = zbase()->view()->getBreadcrumb();
    $i = 0;
    ?>
		<?php 
    if (!empty($breadcrumbs)) {
        ?>

			<?php 
        foreach ($breadcrumbs as $crumb) {
            ?>
				<?php 
            $i++;
            ?>
				<?php 
            $url = zbase_url_from_config($crumb);
            ?>
				<li>
					<a title="<?php 
            echo !empty($crumb['title']) ? $crumb['title'] : $crumb['label'];
            ?>
" href="<?php 
            echo $url;
            ?>
">
						<?php 
            echo $crumb['label'];
            ?>
					</a>
					<?php 
            if ($i < count($breadcrumbs)) {