/** * create the content of upcoming dates * @return string html-content * @global Options determine how many days before event should contact be shown? */ function innerCreate() { global $options, $CONFIG_DATELIST_NAME_SPEC; $contacts = $this->contactList->getContacts(); $dates = $this->contactList->getDates(); $data = array(); $time = getdate(); if (!isset($CONFIG_DATELIST_NAME_SPEC)) { $spec = null; } else { $spec = $CONFIG_DATELIST_NAME_SPEC; } foreach ($contacts as $k => $c) { $data[] = array('display_name' => $c->generateFullName('html', $spec), 'type' => $dates[$k]['type'], 'time' => date('M j', strtotime('1975-' . $dates[$k]['month'] . '-' . $dates[$k]['day'])) . ($dates[$k]['year'] != '0000' ? ', ' . $dates[$k]['year'] : ''), 'age' => intval($time['year'] - $dates[$k]['year']) . 'y', 'daysAway' => $dates[$k]['daysAway'] > 0 ? $dates[$k]['daysAway'] . 'd' : 'today'); } $tGen = new TableGenerator('changed-list'); $cont = '<table class="changed-list">'; $cont .= '<caption>Upcoming dates (Next ' . $options->getOption('bdayInterval') . ' days)</caption>'; if (count($data) > 0) { $cont .= $tGen->generateBody($data, array('display_name', 'type', 'time', 'age', 'daysAway')); } else { $cont .= '<tr class="noentry"><td>Nothing upcoming</td></tr>'; } $cont .= '</table>'; return HTMLHelper::createNestedDivBoxModel('changed-list', $cont); }
/** * create the content of the options page * @return string html-content * @global ErrorHandler used for error handling * @uses createPasswordForm() * @uses createEmailForm() * @uses createOptionsForm() */ function innerCreate() { global $errorHandler; $cont = '<div class="options">'; $cont .= $this->nav->create(); $box = ''; $rightsManager = RightsManager::getSingleton(); if (!$rightsManager->isSelf($this->user)) { $box .= '<div class="options-title">Edit the options of ' . $this->user->contact['lastname'] . ', ' . $this->user->contact['firstname'] . '</div>'; } else { $box .= '<div class="options-title">Edit your options</div>'; } $box .= '<div class="options-box">'; if ($rightsManager->currentUserIsAllowedTo('edit-options-password', $this->user)) { $box .= $this->createPasswordForm(); } if ($rightsManager->currentUserIsAllowedTo('edit-options-regemail', $this->user)) { $box .= $this->createEmailForm(); } if ($rightsManager->currentUserIsAllowedTo('edit-options-useroptions', $this->user)) { $box .= $this->createOptionsForm(); } $box .= '</div>'; return $cont . HTMLHelper::createNestedDivBoxModel('options-content', $box) . '</div>'; }
/** * create the content of admin panel * @return string html-content * @global ErrorHandler used for error handling * @uses createPluginForm() * @uses createUserManagementForm() * @uses createOptionsForm() * @uses createBackupDatabaseForm() */ function innerCreate() { $cont = '<div class="admin-panel">'; $cont .= $this->nav->create(); $box = '<div class="admin-content">'; $box .= '<div class="admin-title">Administration Options</div>'; $box .= '<div class="admin-box">'; $box .= $this->createUserManagementForm(); $box .= $this->createPluginForm(); $box .= $this->createBackupDatabaseForm(); $box .= $this->createOptionsForm(); $box .= $this->createGroupTableEditor(); $box .= '</div></div>'; return $cont . HTMLHelper::createNestedDivBoxModel('admin-content', $box) . '</div>'; }
/** * creates list of contacts, or a no entries found page * @return string html-content */ function innerCreate() { $cont = '<div class="options">'; $cont .= $this->nav->create(); $box = '<div class="options-title">Import</div>'; $box .= '<form action="import.php" method="post">'; $box .= '<div><label for="mails">Paste text data:</label></div>'; $box .= '<div><textarea name="text" id="text" cols="60" rows="20"></textarea></div>'; $box .= '<br><div>'; //<fieldset><legend>Format</legend>'; $box .= HTMLHelper::createRadioButton('format', 'vCard(s)', 'vCard', true, null, false); //$box .= HTMLHelper::createRadioButton('format','vCard(s)','csv',true,null,false); $box .= '</div>'; $box .= '<br><div>'; //<fieldset><legend>Next</legend>'; $box .= HTMLHelper::createRadioButton('continue', 'More input', 'interface', true, null, false); $box .= HTMLHelper::createRadioButton('continue', 'Review last card', 'card', false, null, false); $box .= '</div>'; $box .= '<br><div><input type="submit"/></div>'; $box .= '</form>'; return $cont . HTMLHelper::createNestedDivBoxModel('options-content', $box) . '</div>'; }
/** * create the content of admin panel * @return string html-content * @global ErrorHandler used for error handling * @global PluginManager used for plugin handling (i.e. additional editable fields) * @uses createNameFieldset() * @uses createAddressFieldset() * @uses createProperties() * @uses createMugshotFieldset() * @uses createNotesFieldset() * @uses createGroupsFieldset() */ function innerCreate() { global $errorHandler, $pluginManager; $outer = '<div class="edit-container">'; $outer .= $this->menu->create(); $outer .= '<div class="clear-both"></div>'; if ($this->add) { $cont = '<div class="edit-title">Add new entry</div>'; } else { $cont = '<div class="edit-title">Edit entry for ' . $this->contact->contact['firstname'] . ' ' . $this->contact->contact['lastname'] . '</div>'; } $cont .= '<div class="edit-box">'; $cont .= '<form enctype="multipart/form-data" name="editEntry" method="post" action="?mode=save">'; if (!$this->add) { $cont .= '<input type="hidden" name="contact[id]" value="' . $this->contact->contact['id'] . '" />'; } // ========== NAME AND ADDRESS ========== $cont .= $this->createNameFieldset(); $cont .= $this->createAddressFieldset(); // ========== Preload Data from Contact ========== $this->valueGroups['phone'] = $this->contact->getValueGroup('phone'); $this->valueGroups['email'] = $this->contact->getValueGroup('email'); $this->valueGroups['chat'] = $this->contact->getValueGroup('chat'); $this->valueGroups['www'] = $this->contact->getValueGroup('www'); $this->valueGroups['other'] = $this->contact->getValueGroup('other'); //================ MANDATORY ================ // EXAMPLE for ADDING MANDATORY/SUGGESTED fields: uncomment the following code block // I suggest you put the class into MyPageContactEdit.class.php and replace this class (see config.php) $cont .= '<fieldset class="edit-additionals">'; $cont .= '<legend>Contact</legend>'; $cont .= $this->createFixedPropertyInput('phone', 'Tel', 'visible'); $cont .= $this->createFixedPropertyInput('phone', 'Mobile', 'visible'); $cont .= $this->createFixedPropertyInput('other', 'Fax', 'visible'); $cont .= $this->createFixedPropertyInput('email', 'E-Mail', 'visible'); $cont .= '</fieldset>'; $cont .= '<fieldset class="edit-additionals">'; $cont .= '<legend>Job</legend>'; $cont .= $this->createFixedPropertyInput('other', 'Job Title', 'visible'); $cont .= $this->createFixedPropertyInput('other', 'Superior', 'visible'); $cont .= $this->createFixedPropertyInput('other', 'Prof. qualification', 'visible'); $cont .= $this->createFixedPropertyInput('other', 'Prof. qualification', 'visible'); $cont .= '</fieldset>'; // ========== Communications ========== $cont .= '<fieldset class="edit-additionals">'; $cont .= '<legend>Communications</legend>'; $cont .= $this->editHint(); $opt = array('email' => 'email', 'phone' => 'phone', 'chat' => 'chat', ' ' => 'delete'); $cont .= $this->createNormalProperties($opt, 'email'); $cont .= $this->createNormalProperties($opt, 'phone'); $cont .= $this->createNormalProperties($opt, 'chat'); $cont .= $this->createNormalProperties($opt, 'blank'); $cont .= '</fieldset>'; // ========== Information ========== $cont .= '<fieldset class="edit-additionals">'; $cont .= '<legend>Information</legend>'; $cont .= $this->editHint(); $opt = array('other' => 'other', 'www' => 'url', ' ' => 'delete'); $cont .= $this->createNormalProperties($opt, 'www', 90, 310); $cont .= $this->createNormalProperties($opt, 'other', 90, 310); $cont .= $this->createNormalProperties($opt, 'blank', 90, 310); $cont .= '</fieldset>'; // ========== Dates ========== $cont .= '<fieldset class="edit-additionals">'; $cont .= '<legend>Dates</legend>'; $cont .= $this->editHint('date'); $opt = array('yearly' => 'yearly', 'monthly' => 'monthly', 'weekly' => 'weekly', 'once' => 'once', 'autoremove' => 'autoremove', ' ' => 'delete'); $cont .= $this->createDates($opt, 'date', 18, array(10, 10)); $cont .= $this->createDates($opt, 'blank_date', 18, array(10, 10)); $cont .= '</fieldset>'; $cont .= '<fieldset class="edit-additionals">'; $cont .= '<legend>Plugins</legend>'; $cont .= '<div class="edit-line">'; $cont .= $pluginManager->editContactInterface($this->contact, 'otherInfo'); $cont .= '</div>'; $cont .= '</fieldset>'; $cont .= $pluginManager->editContactInterface($this->contact, 'ownFieldset'); $cont .= $this->createMugshotFieldset(); $cont .= $this->createNotesFieldset(); $cont .= $this->createGroupsFieldset(); $cont .= '</form>'; $cont .= $this->menu->create('edit-menu'); $cont .= '<br></div>'; if (isset($this->contact->contact['lastUpdate'])) { $cont .= '<div class="update">This entry was last updated on ' . $this->contact->contact['lastUpdate'] . '</div>'; } return $outer . HTMLHelper::createNestedDivBoxModel('edit-content', $cont) . '</div>'; }
/** * creates the traditional output of TAB */ function createNormalContact() { global $pluginManager, $CONFIG_CONTACT_NAME_SPEC; if (!isset($CONFIG_CONTACT_NAME_SPEC)) { $CONFIG_CONTACT_NAME_SPEC = array(array('namePrefix', ' '), array('firstname', ' '), array('middlename', ' '), 'lastname', array(', ', 'nameSuffix')); } $title = HTMLHelper::createNestedDivBoxModel('card-title', $this->contact->groups() . $this->contact->generateFullName('html', $CONFIG_CONTACT_NAME_SPEC)); $top = '<div class="card-top">'; $top .= $this->image->html('card-picture'); $top .= $this->contact->addresses(); // Output emphomess $top .= '<div class="card-emphomess">'; $top .= $this->contact->emails(NULL, NULL); // return not address associated emails $top .= $this->contact->phones(NULL, NULL); $top .= $this->contact->messaging(NULL, NULL); $top .= '</div></div>'; $bot = '<div class="card-bottom">'; $bot .= $this->contact->additionals(NULL, NULL); $bot .= $this->contact->dates(NULL, NULL); $bot .= $this->contact->webs(NULL, NULL); $bot .= $pluginManager->contactOutput($this->contact, 'beforeNotes'); $bot .= $this->createUserInfo(); $bot .= $this->contact->notes(); $bot .= '</div>'; $box = $title . HTMLHelper::createNestedDivBoxModel('card-box', $top . $bot); $link = ''; if (isset($this->contact->contact['whoModified'])) { $who = new User(intval($this->contact->contact['whoModified'])); if (isset($who->contact['id'])) { $link = ' by <a class="update" href="' . $_SERVER['PHP_SELF'] . '?id=' . $who->contact['id'] . '">' . $who->contact['lastname'] . ', ' . $who->contact['firstname'] . '</a>'; } else { $errorHandler->clear('argVal'); } } $footer = '<div class="update"><span>This entry was last updated on</span> ' . $this->contact->contact['lastUpdate'] . $link . '</div></div>'; return '<div class="vcard">' . $box . '</div>' . $footer; }
/** * create the content of admin panel * @return string html-content * @global ErrorHandler used for error handling * @global PluginManager used for plugin handling (i.e. additional editable fields) * @uses createXSLTContact() * @uses createMandatoryPropertyFields() * @uses createNameFieldset() * @uses createAddressFieldset() * @uses createProperties() * @uses createMugshotFieldset() * @uses createNotesFieldset() * @uses createGroupsFieldset() */ function innerCreate() { global $errorHandler; $outer = '<div class="edit-container">'; $outer .= $this->menu->create(); $outer .= '<div class="clear-both"></div>'; // is there a XSLT stylesheet to display the contact? if ($this->enableXSLTProcessing && !empty($this->contact->contact['xsltDisplayType'])) { $transformationFile = 'lib/xslt/' . $this->contact->contact['xsltDisplayType'] . '-edit.xsl'; if (file_exists($transformationFile)) { $cont = $this->createXSLTEditPage($transformationFile); } else { $errorHandler->warning('File not found: ' . $transformationFile, basename($_SERVER['SCRIPT_NAME'])); } } if (!isset($cont)) { $cont = $this->createNormalEditPage(); } return $outer . HTMLHelper::createNestedDivBoxModel('edit-content', $cont) . '</div><script type="text/javascript">widgInit();</script>'; // manual init; fails in FF if onload is already set }
/** * creates html from currently saved links * * creates a navigation based on nested <ul>'s. Formatting has to be done with css * @param string $class css class for the top-level <ul> * @return string html for the navigation */ function create() { if (empty($this->content) || count($this->content) <= 0) { return ''; } $classhtml = $this->cssclass ? ' class="' . $this->cssclass . '"' : ''; $cont = "<ul {$classhtml}>\n"; foreach ($this->content as $id => $v) { $cont .= '<li' . ($this->opening ? ' onmouseover="einblenden(this);" onmouseout="ausblenden(this);"' : '') . '><a id="' . $id . '" href="' . $v['href'] . '" ' . $v['extraAttributes'] . '>' . $v['caption'] . "</a>\n"; if (isset($v[0])) { $cont .= "<ul>\n"; $i = 0; while (isset($v[$i])) { $cont .= '<li><a href="' . $v[$i]['href'] . '" ' . $v[$i]['extraAttributes'] . '>' . $v[$i]['caption'] . "</a></li>\n"; $i++; } $cont .= "</ul>\n"; } $cont .= "</li>\n"; } $cont .= "</ul>\n"; return HTMLHelper::createNestedDivBoxModel($this->cssclass, $cont); }
/** * create the table containing the contacts * * @uses Contact * @return string html-content * @global GroupNormalizer used to modify the contact names, in order to get them correctly grouped * @uses TableGenerator */ function createTable() { global $groupNormalizer; // create big table $contacts = $this->contactList->getContacts(); $data = array(); foreach ($contacts as $c) { if ($this->expand) { $p = Page::newPage('PageContact', $c); $data[] = array('cont' => $p->innerCreate(), 'css_class' => 'list-expanded-card', 'group_n' => $groupNormalizer->normalize(mb_substr($c->contact['lastname'], 0, 1))); continue; } $data[] = $c->generateListRowArray(); } $tGen = new TableGenerator('contact-list'); $cont = '<table class="contact-list">'; $cont .= '<caption>' . $this->contactList->getGroupCaption() . '</caption>'; if (count($data) > 0) { if ($this->expand) { $cont .= $tGen->generateBody($data, array('cont'), 'css_class', 'group_n'); } else { $cont .= $tGen->generateBody($data, range(0, count($data[0]) - 3), 'css_class', 'group_n'); } } else { $cont .= '<tr class="noentry"><td>No Entries.</td></tr>'; } $cont .= '</table>'; return HTMLHelper::createNestedDivBoxModel('contact-list', $cont); }
/** * create the content of recently changed * @return string html-content * @param boolean $compact whether list should be displayed with imported link and user who changed contact * @global Options determine how many days after change the contact should still be shown * @global CONFIG_LIST_NAME_SPEC */ function innerCreate() { global $options, $CONFIG_CHANGEDLIST_NAME_SPEC; $contacts = $this->contactList->getContacts(); $data = array(); foreach ($contacts as $c) { $who = new User(intval($c->contact['whoModified'])); if (!isset($CONFIG_CHANGEDLIST_NAME_SPEC)) { $spec = null; } else { $spec = $CONFIG_CHANGEDLIST_NAME_SPEC; } $data[] = array('display_name' => $c->generateFullName('html', $spec), 'chdate' => date('F j', strtotime($c->contact['lastUpdate'])), 'change' => $c->contact['lastModification'], 'reset' => '<a href="../admin/saveadmin.php?id=' . $c->contact['id'] . '&mode=imported">imported</a>', 'who' => isset($who->contact['id']) ? '<a href="../contact/contact.php?id=' . $who->contact['id'] . '">' . $who->contact['lastname'] . (!empty($who->contact['firstname']) ? ', ' . $who->contact['firstname'] : '') . '</a>' : 'null'); } $tGen = new TableGenerator('changed-list'); $cont = '<table class="changed-list">'; $cont .= '<caption>Recently changed (past ' . $options->getOption('bdayInterval') . ' days)'; if (!$this->expanded) { $cont .= ' <a href="../contact/changedlist.php">expand</a>'; } $cont .= '</caption>'; if (count($data) > 0) { if ($_SESSION['user']->isAtLeast('admin') && $this->expanded) { $cont .= $tGen->generateBody($data, array('display_name', 'chdate', 'change', 'reset', 'who')); } else { $cont .= $tGen->generateBody($data, array('display_name', 'chdate', 'change')); } } else { $cont .= '<tr class="noentry"><td>Nothing changed</td></tr>'; } $cont .= '</table>'; if ($this->expanded) { $cont .= '<div><a href="' . Navigation::previousPageUrl() . '">return</a></div><br>'; } return HTMLHelper::createNestedDivBoxModel('changed-list', $cont); }