<fieldset class='drop-shadow'> <?php echo panel_input('attrLabel', $obj, array('labelname' => 'Label', 'model' => 'Tag', 'maxlength' => 255, 'required' => 'true', 'class' => 'medium'), 'getLabel'); ?> <?php echo panel_input('attrTagId', $obj, array('labelname' => 'Tag ID', 'model' => 'Tag', 'maxlength' => 255, 'required' => 'true', 'class' => 'medium'), 'getTagId'); ?> <?php echo panel_input('attrModule', $obj, array('labelname' => 'Module', 'model' => 'Tag', 'maxlength' => 255, 'required' => 'true', 'class' => 'medium'), 'getModule'); ?> <?php echo panel_input('attrDocumentModel', $obj, array('labelname' => 'Document Model', 'model' => 'Tag', 'maxlength' => 255, 'required' => 'true', 'class' => 'medium'), 'getDocumentModel'); ?> <?php echo panel_checkbox('attrExclusive', $obj, array('labelname' => 'Exclusive', 'model' => 'Tag'), 'getExclusive'); ?> <?php echo panel_separator('hr', array('class' => 'brake')); ?> <?php if (count($tags) > 0) { echo panel_tags($tags, $obj); echo panel_separator('hr', array('class' => 'brake')); } ?> <?php echo panel_save_button(array('div' => 'buttons', 'class' => 'submit', 'value' => 'Save changes')); ?> <?php
<?php echo panel_input('attrPassword', $obj, array('labelname' => 'Password', 'model' => 'User', 'maxlength' => '50', 'class' => 'large'), 'getPassword'); ?> <?php echo panel_input('Confirmpass', $obj, array('labelname' => 'Confirm password', 'model' => 'User', 'maxlength' => '50', 'validate' => 'compare', 'class' => 'large'), 'getConfirmpass'); ?> <?php echo panel_input('attrPhone', $obj, array('labelname' => 'Phone', 'model' => 'User', 'maxlength' => '20'), 'getPhone'); ?> <?php echo panel_separator('hr', array('class' => 'brake')); if (strstr($user->getType(), 'admin')) { ?> <?php echo panel_checkbox('attrBackend', $obj, array('labelname' => 'Backend', 'model' => 'User'), 'getBackend'); } else { ?> <?php echo panel_hidden('attrBackend', $obj, array('labelname' => 'Backend', 'model' => 'User'), 'getBackend'); } ?> <?php echo panel_select('attrType', $obj, Lists::getListitemsForSelect('usertype'), array('labelname' => 'Type', 'model' => 'User', 'class' => 'medium'), 'getType'); ?> <?php //echo panel_date('attrBirthDate', $obj, array('labelname' => 'BirthDate' , 'model' => 'User'), 'getBirthDate'); ?> <?php echo panel_separator('hr', array('class' => 'brake'));
function panel_tags($tags, $obj, $id = null) { if ($id) { $obj = Document::getDocumentInstance($id); } // if(substr(get_class($obj),-4) == "I18n") $obj = Document::getParentOf($obj->getId()); $count = count($tags); $user = sfContext::getInstance()->getUser()->getSubscriber(); if ($count == 0 || $user && $user->getType() != "admin") { return; } if ($count) { $width = intval(100 / $count) - 1; } if ($count > 4) { $width = 16; } if ($count) { $widthStr = 'width="' . $width . '%"'; } if ($count > 0) { $code = "<h3>Tags</h3>\n\t\t<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n"; } $ind = 0; foreach ($tags as $tag) { if ($ind % 6 == 0) { $code .= "\t<tr>\n"; $closed = false; } $code .= "\t\t<td width='20'>\n" . "\t\t\t" . panel_checkbox('tag_id_' . $tag->getId(), Document::hasTag($obj, $tag->getTagId()), array('class' => 'check_box', 'labelname' => '', 'no_wrapper' => 1)) . "\n" . "\t\t</td>\n" . "\t\t<td " . $widthStr . " class=\"label_checkbox\">" . $tag->getLabel() . "</td>\n"; if ($ind % 6 == 5) { $code .= "\t</tr>\n"; $closed = true; } $ind++; } if ($count > 0) { if (!$closed) { $code .= "\t</tr>\n"; } $code .= "</table>"; } return $code; }
} else { $user = $sf_user->getSubscriber(); if ($user && $user->getType() == 'admin') { echo panel_select('attrTemplate', $obj, $template, array('labelname' => 'Template', 'model' => 'PageI18n', 'required' => 'true', 'class' => 'medium', 'wait' => 1), 'getTemplate'); } else { echo panel_select('attrTemplate', $obj, $template, array('labelname' => 'Template', 'model' => 'PageI18n', 'disabled' => 'true', 'class' => 'medium'), 'getTemplate'); } } ?> <div id="richtext_contents"> <?php echo panel_textarea('attrContent', $obj, array('labelname' => 'Content', 'model' => 'PageI18n', 'size' => '50x5', 'richtext' => 'true', 'parse' => 1, 'class' => 'mceEditor'), 'getContent'); ?> </div> <?php echo panel_checkbox('attrIsSecure', $obj, array('labelname' => 'Is secure', 'model' => 'PageI18n'), 'getIsSecure'); ?> <?php //echo panel_select('attrCulture', $obj, Lists::getListitemsForSelect('culture'), array('labelname' => 'Culture' , 'model' => 'PageI18n', 'unique' => 'true', 'required' => 'true', 'class' => 'medium'), 'getCulture'); ?> </div> <?php if ($obj) { echo panel_gallery($obj->getId(), array('labelname' => 'Images gallery', 'width' => '600', 'thumb_width' => '120', 'path' => 'upload')); } ?> <?php echo panel_separator('hr', array('class' => 'brake')); ?> <?php