Changeset 11774

Show
Ignore:
Timestamp:
08/28/07 15:57:36 (1 year ago)
Author:
w_i
Message:

Prettyfied the component

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/midcom/com.magnettechnologies.contactgrabber/contactgrabber.php

    r11471 r11774  
    4040        $this->_component = 'com.magnettechnologies.contactgrabber'; 
    4141        parent::midcom_baseclasses_components_purecode(); 
    42     } 
     42         
     43        $_MIDCOM->style->append_component_styledir('com.magnettechnologies.contactgrabber'); 
     44         
     45        $_MIDCOM->add_link_head 
     46        ( 
     47            array 
     48            ( 
     49                'rel' => 'stylesheet', 
     50                'type' => 'text/css', 
     51                'href' => MIDCOM_STATIC_URL."/com.magnettechnologies.contactgraper/styles/elements.css", 
     52            ) 
     53        ); 
    4354 
    44     function _show_search_form() 
    45     { 
    46     ?> 
    47         <script language="javascript"> 
    48             function checkEmpty(frm) 
    49             { 
    50                 if (frm.username.value == "" || frm.password.value == "") 
    51                 { 
    52                     alert("Please enter username & password."); 
    53                     frm.username.focus(); 
    54                     return false; 
    55                 } 
    56                 return true; 
    57             } 
    58            </script> 
    59  
    60            <form  method="POST" onSubmit="return checkEmpty(this);" name="loginForm"> 
    61              <table border="0" cellpadding="2" cellspacing="0"> 
    62                <tr><td colspan="3" align="center"><?php echo $this->_l10n->get('enter login details to fetch your contacts'); ?></td></tr> 
    63                <tr><td><?php echo $this->_l10n->get('username'); ?></td><td><input type="text" name="username" value="<?php /*echo $username;*/ ?>" /></td> 
    64                  <td>    
    65                  <select name="domain" size="1"> 
    66                    <option value="gmail.com" <?php if (isset($_POST['domain']) && $_POST['domain']=="gmail.com") echo 'selected'; ?>>gmail</option> 
    67                    <option value="hotmail.com" <?php if (isset($_POST['domain']) && $_POST['domain']=="hotmail.com") echo 'selected'; ?>>hotmail</option> 
    68                    <option value="rediff.com" <?php if (isset($_POST['domain']) && $_POST['domain']=="rediff.com") echo 'selected'; ?>>rediff</option>           
    69                    <option value="yahoo.com" <?php if (isset($_POST['domain']) && $_POST['domain']=="yahoo.com") echo 'selected'; ?>>yahoo</option> 
    70                    <option value="orkut.com" <?php if (isset($_POST['domain']) && $_POST['domain']=="orkut.com") echo 'selected'; ?>>orkut</option> 
    71                    <option value="myspace.com" <?php if (isset($_POST['domain']) && $_POST['domain']=="myspace.com") echo 'selected'; ?>>myspace</option> 
    72                  </select> 
    73                  </td> 
    74                </tr> 
    75                <tr><td><?php echo $this->_l10n->get('password'); ?></td> 
    76                  <td colspan="2"><input type="password" name="password" /></td> 
    77               </tr> 
    78               <tr><td colspan="3" align="center"><input type="submit" value="<?php echo $this->_l10n->get('fetch my contacts'); ?>" /></td></tr>     
    79               <tr><td colspan="3" align="center"><small><?php echo $this->_l10n->get('no details are stored'); ?></small></td></tr>     
    80             </table> 
    81           </form> 
    82       <?php 
     55        $_MIDCOM->enable_jquery(); 
     56        $_MIDCOM->add_jsfile(MIDCOM_STATIC_URL . '/com.magnettechnologies.contactgraper/js/common.js'); 
    8357    } 
    8458 
     
    136110    function _crab_contacts() 
    137111    { 
    138         $this->_show_search_form(); 
    139         $this->_create_resource_object(); 
     112        // $this->_show_search_form(); 
     113            $this->_create_resource_object(); 
    140114 
    141       if (isset($this->_resource_obj)) 
    142        
    143           $contacts = $this->_resource_obj->getAddressbook($this->_email, $this->_password); 
    144           if(is_array($contacts)) 
    145           { 
    146                 $clean_contacts = array(); 
     115      if (isset($this->_resource_obj)) 
     116           
     117          $contacts = $this->_resource_obj->getAddressbook($this->_email, $this->_password); 
     118          if(is_array($contacts)) 
     119          { 
     120                    $clean_contacts = array(); 
    147121 
    148                 // Removing if email value is empty 
    149               foreach($contacts['email'] as $key => $email) 
    150               { 
    151                     if (!empty($email)) 
    152                   { 
    153                         $clean_contacts['email'][$key] = $email; 
    154                       $clean_contacts['name'][$key] = $contacts['name'][$key]; 
    155                   } 
    156               } 
     122                    // Removing if email value is empty 
     123              foreach($contacts['email'] as $key => $email) 
     124              { 
     125                        if (!empty($email)) 
     126                  { 
     127                            $clean_contacts['email'][$key] = $email; 
     128                      $clean_contacts['name'][$key] = $contacts['name'][$key]; 
     129                  } 
     130              } 
    157131 
    158                 return $clean_contacts; 
    159             } 
    160         } 
     132                    return $clean_contacts; 
     133            } 
     134        } 
     135    } 
     136 
     137    function show_search_form() 
     138    { 
     139        midcom_show_style('search-form'); 
    161140    } 
    162141} 
  • trunk/midcom/com.magnettechnologies.contactgrabber/locale/default.en.txt

    r11454 r11774  
    77---STRINGEND 
    88 
    9 ---STRING fetch my contacts 
    10 Fetch my contacts 
     9---STRING fetch 
     10Fetch 
    1111---STRINGEND 
    1212 
    1313---STRING no details are stored 
    14 No details are stored 
     14Your contacts are your private information. We will not store your username or password. Any information you upload will be securely imported for your own use only 
    1515---STRINGEND 
    1616