Changeset 11774
- Timestamp:
- 08/28/07 15:57:36 (1 year ago)
- Files:
-
- trunk/midcom/com.magnettechnologies.contactgrabber/contactgrabber.php (modified) (2 diffs)
- trunk/midcom/com.magnettechnologies.contactgrabber/locale/default.en.txt (modified) (1 diff)
- trunk/midcom/com.magnettechnologies.contactgrabber/static/images (added)
- trunk/midcom/com.magnettechnologies.contactgrabber/static/images/invite_block_bg.gif (added)
- trunk/midcom/com.magnettechnologies.contactgrabber/static/images/invite_tab_active_gmail.gif (added)
- trunk/midcom/com.magnettechnologies.contactgrabber/static/images/invite_tab_active_hotmail.gif (added)
- trunk/midcom/com.magnettechnologies.contactgrabber/static/images/invite_tab_active_myspace.gif (added)
- trunk/midcom/com.magnettechnologies.contactgrabber/static/images/invite_tab_active_yahoo.gif (added)
- trunk/midcom/com.magnettechnologies.contactgrabber/static/images/invite_tab_gmail.gif (added)
- trunk/midcom/com.magnettechnologies.contactgrabber/static/images/invite_tab_hotmail.gif (added)
- trunk/midcom/com.magnettechnologies.contactgrabber/static/images/invite_tab_myspace.gif (added)
- trunk/midcom/com.magnettechnologies.contactgrabber/static/images/invite_tab_yahoo.gif (added)
- trunk/midcom/com.magnettechnologies.contactgrabber/static/js (added)
- trunk/midcom/com.magnettechnologies.contactgrabber/static/js/common.js (added)
- trunk/midcom/com.magnettechnologies.contactgrabber/static/styles (added)
- trunk/midcom/com.magnettechnologies.contactgrabber/static/styles/elements.css (added)
- trunk/midcom/com.magnettechnologies.contactgrabber/style/search-form.php (added)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/midcom/com.magnettechnologies.contactgrabber/contactgrabber.php
r11471 r11774 40 40 $this->_component = 'com.magnettechnologies.contactgrabber'; 41 41 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 ); 43 54 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'); 83 57 } 84 58 … … 136 110 function _crab_contacts() 137 111 { 138 $this->_show_search_form();139 $this->_create_resource_object();112 // $this->_show_search_form(); 113 $this->_create_resource_object(); 140 114 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(); 147 121 148 // Removing if email value is empty149 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 } 157 131 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'); 161 140 } 162 141 } trunk/midcom/com.magnettechnologies.contactgrabber/locale/default.en.txt
r11454 r11774 7 7 ---STRINGEND 8 8 9 ---STRING fetch my contacts10 Fetch my contacts9 ---STRING fetch 10 Fetch 11 11 ---STRINGEND 12 12 13 13 ---STRING no details are stored 14 No details are stored 14 Your 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 15 15 ---STRINGEND 16 16
