/**
 * Function to generate login form
 *
 * This function generate login form
 * 
 *
 * @param $params contains option of the generated result
 * @param $template to associate generated result
 *
 * @return string HTML code of the login form <form>...</form>
 */
function smarty_function_sirclo_render_login_form($params, $template)
{
    $_btn_class = !empty($params['btn_class']) ? $params['btn_class'] : 'btn-flat';
    $_lang = !empty($params['lang']) ? $params['lang'] : "en";
    $_label_email = $_lang == "id" ? "E-mail" : "E-mail";
    $_label_password = $_lang == "id" ? "Password" : "Password";
    $params['fields'] = array(array('name' => 'username', 'type' => 'emailLogin', 'value' => '', 'label' => 'E-mail', 'attribute' => 'required'), array('name' => 'password', 'type' => 'passwordLogin', 'value' => '', 'label' => 'Password', 'attribute' => 'required'), array('name' => '', 'type' => 'submit', 'value' => 'LOGIN', 'label' => '', 'attribute' => 'class="' . $_btn_class . '"'));
    $_html = Helper_Renderer::renderForm($params);
    return $_html;
}
Ejemplo n.º 2
0
 static function sircloRenderTestimonialForm($params)
 {
     $_btn_class = !empty($params['btn_class']) ? $params['btn_class'] : 'btn-flat';
     $_lang = !empty($params['lang']) ? $params['lang'] : "en";
     $_label_name = $_lang == "id" ? "Nama Anda" : "Your Name";
     $_label_author_desc = $_lang == "id" ? "Profil Anda" : "Your Profile";
     $_label_testimonial = $_lang == "id" ? "Testimonial" : "Testimonial";
     $_label_email = $_lang == "id" ? "Email" : "Email";
     $_label_company = $_lang == "id" ? "Company" : "Company";
     $_label_website = $_lang == "id" ? "Website" : "Website";
     $_label_image = $_lang == "id" ? "Picture" : "Picture";
     $params['fields'] = array(array('name' => 'author', 'type' => 'text', 'value' => '', 'label' => $_label_name, 'attribute' => 'required'), array('name' => 'email', 'type' => 'text', 'value' => '', 'label' => $_label_email, 'attribute' => ''), array('name' => 'company', 'type' => 'text', 'value' => '', 'label' => $_label_company, 'attribute' => ''), array('name' => 'website', 'type' => 'text', 'value' => '', 'label' => $_label_website, 'attribute' => ''), array('name' => 'content', 'type' => 'textarea', 'value' => '', 'label' => $_label_testimonial, 'attribute' => 'required'), array('name' => 'picture', 'type' => 'file', 'label' => $_label_image), array('name' => '', 'type' => 'submit', 'value' => 'Submit Testimonial', 'label' => '', 'attribute' => 'class="' . $_btn_class . '"'));
     $html = Helper_Renderer::renderForm($params);
     return $html;
 }