Skip to content

Instantly share code, notes, and snippets.

@pupi1985
Last active June 11, 2016 05:42

Revisions

  1. pupi1985 revised this gist Aug 18, 2014. 1 changed file with 14 additions and 3 deletions.
    17 changes: 14 additions & 3 deletions qa-theme-base.php
    Original file line number Diff line number Diff line change
    @@ -5,12 +5,23 @@ function page_title_error()
    if (isset($favorite))
    $this->output('<form '.$favorite['form_tags'].'>');

    $class = $this->template === 'qa' ? ' class="recent-questions"' : '';
    echo 'Template: ' . $this->template . ' ';
    switch ($this->template) {
    case 'qa':
    $class = ' class="recent-questions"';
    break;
    case 'some-other-template-you-want':
    $class = ' class="another-class-to-apply-css"';
    break;
    default:
    $class = '';
    }

    $this->output('<h1' . $class . '>');
    $tag = 'h1';
    $this->output('<' . $tag . $class . '>');
    $this->favorite();
    $this->title();
    $this->output('</h1>');
    $this->output('</' . $tag . '>');

    if (isset($this->content['error']))
    $this->error(@$this->content['error']);
  2. pupi1985 revised this gist Aug 18, 2014. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion qa-theme-base.php
    Original file line number Diff line number Diff line change
    @@ -5,7 +5,9 @@ function page_title_error()
    if (isset($favorite))
    $this->output('<form '.$favorite['form_tags'].'>');

    $this->output('<h1>');
    $class = $this->template === 'qa' ? ' class="recent-questions"' : '';

    $this->output('<h1' . $class . '>');
    $this->favorite();
    $this->title();
    $this->output('</h1>');
  3. pupi1985 created this gist Aug 18, 2014.
    20 changes: 20 additions & 0 deletions qa-theme-base.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,20 @@
    function page_title_error()
    {
    $favorite=@$this->content['favorite'];

    if (isset($favorite))
    $this->output('<form '.$favorite['form_tags'].'>');

    $this->output('<h1>');
    $this->favorite();
    $this->title();
    $this->output('</h1>');

    if (isset($this->content['error']))
    $this->error(@$this->content['error']);

    if (isset($favorite)) {
    $this->form_hidden_elements(@$favorite['form_hidden']);
    $this->output('</form>');
    }
    }