Пример #1
0
function theme_error($message)
{
    theme_page('Error', $message);
}
Пример #2
0
function bigtouch_theme_page($title, $content)
{
    return theme_page($title, $content);
}
                break;
            case 'form':
                $output .= build_form($values['value']);
                break;
        }
    }
    return $output;
}
/**
 * Renders the page content based on a simple template.
 */
function theme_page($output, $title)
{
    return '
    <html>
      <head>
        <title>' . $title . '</title>
      </head>
      <body>
        ' . $output . '
      </body>
    </html>';
}
// Create an array for the contact form.
$contact_form = array('name' => array('title' => 'Name', 'type' => 'text', 'validations' => array('not_empty')), 'email' => array('title' => 'Email', 'type' => 'email', 'validations' => array('not_empty', 'is_valid_email')), 'comment' => array('title' => 'Comments', 'type' => 'textarea', 'validations' => array('not_empty')), 'submit' => array('title' => 'Submit me!', 'type' => 'submit'));
// Create an array for the page.
$page_elements = array('header' => array('type' => 'html', 'value' => '<p>Please submit this form. You will make my day if you do.</p>'), 'contact_form' => array('type' => 'form', 'value' => $contact_form));
// Render the page content.
$page_content = build_page($page_elements);
print theme_page($page_content, 'Contact us');
Пример #4
0
function theme_error($message, $response = NULL, $post = NULL)
{
    if ($response->errors) {
        $errors = current($response->errors);
        $error_message = $errors->message;
        $error_code = $errors->code;
    }
    //	Handle overly long messages by allowing the user to re-edit them.
    if (186 == $error_code) {
        $status = $post->status;
        $message .= theme_status_form($post["status"], $post["in_reply_to_id"]);
    }
    theme_page(_(ERROR), $message);
}