//print_r($pages);
        ?>

	    <form action="<?php 
        echo module_social_twitter::link_open_message_view($social_twitter_id);
        ?>
" method="post" enctype="multipart/form-data">
		    <input type="hidden" name="_process" value="send_twitter_message">
		    <?php 
        module_form::print_form_auth();
        ?>
		    <?php 
        $fieldset_data = array('heading' => isset($_REQUEST['display_mode']) && $_REQUEST['display_mode'] == 'ajax' ? false : array('type' => 'h3', 'title' => 'Compose Tweet'), 'class' => 'tableclass tableclass_form tableclass_full', 'elements' => array('twitter_account' => array('title' => _l('Twitter Account'), 'fields' => array()), 'message' => array('title' => _l('Message'), 'field' => array('type' => 'textarea', 'name' => 'message', 'id' => 'twitter_compose_message', 'value' => '')), 'type' => array('title' => _l('Type'), 'fields' => array('<input type="radio" name="post_type" id="post_type_wall" value="wall" checked> ', '<label for="post_type_wall">', _l('Normal Tweet'), '</label>', '<input type="radio" name="post_type" id="post_type_picture" value="picture"> ', '<label for="post_type_picture">', _l('Picture Tweet'), '</label>')), 'picture' => array('title' => _l('Picture'), 'fields' => array('<input type="file" name="picture" value=""> (ensure picture is smaller than 1200x1200)', '<span class="twitter-type-picture twitter-type-option"></span>')), 'debug' => array('title' => _l('Debug'), 'field' => array('type' => 'check', 'name' => 'debug', 'value' => '1', 'checked' => false, 'help' => 'Show debug output while posting the message'))));
        //foreach($accounts as $twitter_account_id => $account){
        // do we have a picture?
        $fieldset_data['elements']['twitter_account']['fields'][] = '<div id="twitter_compose_account_select">' . '<input type="checkbox" name="compose_account_id[' . $twitter->get('social_twitter_id') . ']" value="1" checked> ' . ($twitter->get_picture() ? '<img src="' . $twitter->get_picture() . '">' : '') . htmlspecialchars($twitter->get('twitter_name')) . '</div>';
        //}
        echo module_form::generate_fieldset($fieldset_data);
        $form_actions = array('class' => 'action_bar action_bar_center', 'elements' => array());
        echo module_form::generate_form_actions($form_actions);
        $form_actions['elements'][] = array('type' => 'save_button', 'name' => 'butt_save', 'value' => _l('Send'));
        // always show a cancel button
        /*$form_actions['elements'][] = array(
        		    'type' => 'button',
        		    'name' => 'cancel',
        		    'value' => _l('Cancel'),
        		    'class' => 'submit_button',
        		    'onclick' => "window.location.href='".$module->link_open_message_view($social_twitter_id)."';",
        		);*/
        echo module_form::generate_form_actions($form_actions);
        ?>